From d133113811f74e67f0bb07231d3126c20e5139ed 2011-12-06 01:41:00 From: MinRK Date: 2011-12-06 01:41:00 Subject: [PATCH] don't use private TestCase._exc_info() method in parametric test In Python 2.6, the method is one line, returning sys.exc_info(), and has been removed in Python 2.7. --- diff --git a/IPython/testing/_paramtestpy2.py b/IPython/testing/_paramtestpy2.py index 368ab09..f4bfa26 100644 --- a/IPython/testing/_paramtestpy2.py +++ b/IPython/testing/_paramtestpy2.py @@ -12,6 +12,7 @@ # Imports #----------------------------------------------------------------------------- +import sys import unittest from compiler.consts import CO_GENERATOR @@ -45,7 +46,7 @@ class ParametricTestCase(unittest.TestCase): except KeyboardInterrupt: raise except: - result.addError(self, self._exc_info()) + result.addError(self, sys.exc_info()) return # Test execution ok = False @@ -56,18 +57,18 @@ class ParametricTestCase(unittest.TestCase): # We stop the loop break 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()) # TearDown 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)