diff options
| author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2019-08-26 12:12:02 +0000 |
|---|---|---|
| committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2019-08-26 12:12:02 +0000 |
| commit | 295c5bfcada570eed9a44a2a312ad80a84262c55 (patch) | |
| tree | d1e8fe373e17c61cf331cc989be69890aa3f20e3 /docutils/test/DocutilsTestSupport.py | |
| parent | b7b360f03d05dbf0e7a69407db982f8d8772e724 (diff) | |
| download | docutils-295c5bfcada570eed9a44a2a312ad80a84262c55.tar.gz | |
py3: Switch to 'except foo as bar' syntax
This is the only form supported in Python 3.x.
Signed-off-by: Stephen Finucane <stephen@that.guru>
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8347 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test/DocutilsTestSupport.py')
| -rw-r--r-- | docutils/test/DocutilsTestSupport.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docutils/test/DocutilsTestSupport.py b/docutils/test/DocutilsTestSupport.py index 479f0e073..b26fc44d8 100644 --- a/docutils/test/DocutilsTestSupport.py +++ b/docutils/test/DocutilsTestSupport.py @@ -230,7 +230,7 @@ class CustomTestCase(StandardTestCase): output = '\n'.join(output.splitlines()) try: self.assertEqual(output, expected) - except AssertionError, error: + except AssertionError as error: print('\n%s\ninput:' % (self,), file=sys.stderr) print(input, file=sys.stderr) try: @@ -543,7 +543,7 @@ class GridTableParserTestCase(CustomTestCase): self.parser.find_head_body_sep() self.parser.parse_table() output = self.parser.cells - except Exception, details: + except Exception as details: output = '%s: %s' % (details.__class__.__name__, details) self.compare_output(self.input, pformat(output) + '\n', pformat(self.expected) + '\n') @@ -552,7 +552,7 @@ class GridTableParserTestCase(CustomTestCase): try: output = self.parser.parse(StringList(string2lines(self.input), 'test data')) - except Exception, details: + except Exception as details: output = '%s: %s' % (details.__class__.__name__, details) self.compare_output(self.input, pformat(output) + '\n', pformat(self.expected) + '\n') @@ -865,7 +865,7 @@ def exception_data(func, *args, **kwds): """ try: func(*args, **kwds) - except Exception, detail: + except Exception as detail: return (detail, detail.args, '%s: %s' % (detail.__class__.__name__, detail)) |
