Skip to content
Browse files

fix more exeptions

2to3 makes a better job than regexp
  • Loading branch information...
1 parent 28b538a commit 90c0a4e83368c3a4dcf56c45705f491bb386c29c @Carreau Carreau committed Jul 1, 2012
Showing with 5 additions and 5 deletions.
  1. +2 −2 docs/sphinxext/docscrape.py
  2. +2 −2 docs/sphinxext/github.py
  3. +1 −1 docs/sphinxext/inheritance_diagram.py
View
4 docs/sphinxext/docscrape.py
@@ -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
@@ -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
View
4 docs/sphinxext/github.py
@@ -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 + '/'
@@ -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
View
2 docs/sphinxext/inheritance_diagram.py
@@ -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

0 comments on commit 90c0a4e

Please sign in to comment.
Something went wrong with that request. Please try again.