diff options
author | Sascha Silbe <sascha-pgp@silbe.org> | 2012-04-22 14:42:23 (GMT) |
---|---|---|
committer | Sascha Silbe <sascha-pgp@silbe.org> | 2012-04-22 14:45:09 (GMT) |
commit | 41cb2e6c208201b3257bbe762d93c3804171ee67 (patch) | |
tree | 52d408e1b31ddde7126adacadc0cfaab7766de32 | |
parent | e351ddb5cb9183ea9f6fd80ae7754db1929a128b (diff) |
tests: add compatibility with Python 2.7
Python 2.7 dropped the unittest.TestCase._exc_info() method. In Python 2.6 it
was just a wrapper around sys.exc_info(), so use that directly, like Python 2.7
does.
-rwxr-xr-x | tests/runalltests.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/runalltests.py b/tests/runalltests.py index 1ed42c9..6b6b25f 100755 --- a/tests/runalltests.py +++ b/tests/runalltests.py @@ -151,7 +151,7 @@ class TestSuiteWrapper(unittest.TestCase): except KeyboardInterrupt: raise except: - result.addError(self, self._exc_info()) + result.addError(self, sys.exc_info()) return ok = False @@ -159,18 +159,18 @@ class TestSuiteWrapper(unittest.TestCase): self.runTest(result) ok = True except self.failureException: - result.addFailure(self, self._exc_info()) + result.addFailure(self, sys.exc_info()) except KeyboardInterrupt: raise except: - result.addError(self, self._exc_info()) + result.addError(self, sys.exc_info()) try: self.tearDown() except KeyboardInterrupt: raise except: - result.addError(self, self._exc_info()) + result.addError(self, sys.exc_info()) ok = False if ok: result.addSuccess(self) |