From 1f2b10afaa824c5f53d418a148dec792a8d3ac53 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Thu, 8 Oct 2009 20:30:07 -0300 Subject: [PATCH] a few Py3k fixes in runtests.py --- runtests.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/runtests.py b/runtests.py index f5e53405..4323dcc3 100644 --- a/runtests.py +++ b/runtests.py @@ -8,7 +8,10 @@ import shutil import unittest import doctest import operator -from StringIO import StringIO +try: + from StringIO import StringIO +except ImportError: + from io import StringIO try: import cPickle as pickle @@ -394,7 +397,7 @@ class CythonRunTestCase(CythonCompileTestCase): try: partial_result = PartialTestResult(result) doctest.DocTestSuite(module_name).run(partial_result) - except Exception, e: + except Exception: partial_result.addError(module_name, sys.exc_info()) result_code = 1 pickle.dump(partial_result.data(), output) -- 2.26.2