Skip to content

Commit

Permalink
fix more exeptions
Browse files Browse the repository at this point in the history
2to3 makes a better job than regexp
  • Loading branch information
Carreau committed Jul 1, 2012
1 parent 28b538a commit 90c0a4e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/sphinxext/docscrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def __init__(self, func, role='func', doc=None):
doc = inspect.getdoc(func) or ''
try:
NumpyDocString.__init__(self, doc)
except ValueError, e:
except ValueError as e:
print '*'*78
print "ERROR: '%s' while parsing `%s`" % (e, self._f)
print '*'*78
Expand All @@ -429,7 +429,7 @@ def __init__(self, func, role='func', doc=None):
argspec = inspect.formatargspec(*argspec)
argspec = argspec.replace('*','\*')
signature = '%s%s' % (func_name, argspec)
except TypeError, e:
except TypeError as e:
signature = '%s()' % func_name
self['Signature'] = signature

Expand Down
4 changes: 2 additions & 2 deletions docs/sphinxext/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def make_link_node(rawtext, app, type, slug, options):
raise AttributeError
if not base.endswith('/'):
base += '/'
except AttributeError, err:
except AttributeError as err:
raise ValueError('github_project_url configuration value is not set (%s)' % str(err))

ref = base + type + '/' + slug + '/'
Expand Down Expand Up @@ -133,7 +133,7 @@ def ghcommit_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
raise AttributeError
if not base.endswith('/'):
base += '/'
except AttributeError, err:
except AttributeError as err:
raise ValueError('github_project_url configuration value is not set (%s)' % str(err))

ref = base + text
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinxext/inheritance_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def visit_inheritance_diagram(inner_func):
def visitor(self, node):
try:
content = inner_func(self, node)
except DotException, e:
except DotException as e:
# Insert the exception as a warning in the document
warning = self.document.reporter.warning(str(e), line=node.line)
warning.parent = node
Expand Down

0 comments on commit 90c0a4e

Please sign in to comment.