From: Lisandro Dalcin Date: Wed, 14 Oct 2009 18:57:48 +0000 (-0300) Subject: fix for unittest changes in upcoming Py2.7 and Py3.2 X-Git-Tag: 0.13.beta0~2^2~121^2~62 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=db48dbe11a7b2074ea5365cb8aac970319bd50a2;p=cython.git fix for unittest changes in upcoming Py2.7 and Py3.2 --- diff --git a/runtests.py b/runtests.py index c19a2903..201f191f 100644 --- a/runtests.py +++ b/runtests.py @@ -427,9 +427,14 @@ class _FakeClass(object): def __init__(self, **kwargs): self.__dict__.update(kwargs) -class PartialTestResult(unittest._TextTestResult): +try: # Py2.7+ and Py3.2+ + from unittest.runner import _TextTestResult +except ImportError: + from unittest import _TextTestResult + +class PartialTestResult(_TextTestResult): def __init__(self, base_result): - unittest._TextTestResult.__init__( + _TextTestResult.__init__( self, self._StringIO(), True, base_result.dots + base_result.showAll*2)