Removing Python 2.3 compatibility code from unittest.

This commit is contained in:
Michael Foord 2010-03-22 01:41:11 +00:00
parent db003cb3d1
commit 49899690a8
3 changed files with 5 additions and 8 deletions

View file

@ -30,11 +30,7 @@ VALID_MODULE_NAME = re.compile(r'[_a-z]\w*\.py$', re.IGNORECASE)
def _make_failed_import_test(name, suiteClass):
message = 'Failed to import test module: %s' % name
if hasattr(traceback, 'format_exc'):
# Python 2.3 compatibility
# format_exc returns two frames of discover.py as well
message += '\n%s' % traceback.format_exc()
message = 'Failed to import test module: %s\n%s' % (name, traceback.format_exc())
return _make_failed_test('ModuleImportFailure', name, ImportError(message),
suiteClass)