Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update #1790 (Python 3 fixes) #1933

Merged
merged 6 commits into from
Jan 16, 2016
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion readthedocs/api/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def sync_versions(self, request, **kwargs):
self._sync_versions(project, data['tags'])
self._sync_versions(project, data['branches'])
deleted_versions = self._delete_versions(project, data)
except Exception, e:
except Exception as e:
return self.create_response(
request,
{'exception': e.message},
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def obj_get_list(self, request=None, *args, **kwargs):

try:
return self.get_object_list(request).filter(**applicable_filters)
except ValueError, e:
except ValueError as e:
raise NotFound(ugettext("Invalid resource lookup data provided "
"(mismatched type).: %(error)s")
% {'error': e})
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def _build_url(url, branches):
url, ' '.join(not_building))
pc_log.info(msg)
return HttpResponse(msg)
except Exception, e:
except Exception as e:
if e.__class__ == NoProjectException:
raise
msg = "(URL Build) Failed: %s:%s" % (url, e)
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/oauth/migrations/0003_move_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def forwards_move_repos(apps, schema_editor):
else:
new_repo.clone_url = data.get('clone_url')
new_repo.json = json.dumps(data)
except SyntaxError, ValueError:
except SyntaxError as ValueError:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a find replace failure

pass
new_repo.save()
log.info('Migrated project: %s', project.name)
Expand Down Expand Up @@ -149,7 +149,7 @@ def forwards_move_repos(apps, schema_editor):
new_repo.clone_url = clone_urls.get('ssh', project.git_url)
else:
new_repo.clone_url = clone_urls.get('https', project.html_url)
except SyntaxError, ValueError:
except SyntaxError as ValueError:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

pass
new_repo.save()
log.info('Migrated project: %s', project.name)
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/projects/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def run(self, pk, version_pk=None, build_pk=None, record=True, docker=False,
_('Builds for this project are temporarily disabled'))
try:
self.setup_vcs()
except vcs_support_utils.LockTimeout, e:
except vcs_support_utils.LockTimeout as e:
self.retry(exc=e, throw=False)
raise BuildEnvironmentError(
'Version locked, retrying in 5 minutes.',
Expand Down Expand Up @@ -452,7 +452,7 @@ def update_imported_docs(version_pk):

try:
api_v2.project(project.pk).sync_versions.post(version_post_data)
except Exception, e:
except Exception as e:
print "Sync Versions Exception: %s" % e.message
return ret_dict

Expand Down