From f592130929febfa1b21fd3aa0edebd134049770e Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 2 May 2008 10:12:09 +0200 Subject: [PATCH] fix test case and make it really test the expected exception type --- Cython/Compiler/Version.py | 2 +- tests/run/new_style_exceptions.pyx | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Cython/Compiler/Version.py b/Cython/Compiler/Version.py index 0cb27c72..83b473fa 100644 --- a/Cython/Compiler/Version.py +++ b/Cython/Compiler/Version.py @@ -1 +1 @@ -version = '0.9.6.13.1' +version = '0.9.6.14' diff --git a/tests/run/new_style_exceptions.pyx b/tests/run/new_style_exceptions.pyx index 4dfcf375..9dbd97cb 100644 --- a/tests/run/new_style_exceptions.pyx +++ b/tests/run/new_style_exceptions.pyx @@ -4,7 +4,7 @@ __doc__ = """ Caught: Exception('hi',) """ -import sys +import sys, types def test(obj): print "Raising: %s%r" % (obj.__class__.__name__, obj.args) @@ -12,4 +12,8 @@ def test(obj): raise obj except: info = sys.exc_info() - print "Caught: %s%r" % (obj.__class__.__name__, obj.args) + if sys.version_info >= (2,5): + assert isinstance(info[0], type) + else: + assert isinstance(info[0], types.ClassType) + print "Caught: %s%r" % (info[1].__class__.__name__, info[1].args) -- 2.26.2