diff options
Diffstat (limited to 'simplejson/tests/test_fail.py')
-rw-r--r-- | simplejson/tests/test_fail.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/simplejson/tests/test_fail.py b/simplejson/tests/test_fail.py index 646c0f4..d388f19 100644 --- a/simplejson/tests/test_fail.py +++ b/simplejson/tests/test_fail.py @@ -1,3 +1,4 @@ +import sys from unittest import TestCase import simplejson as json @@ -81,11 +82,13 @@ class TestFail(TestCase): for doc in [u'[,]', '[,]']: try: json.loads(doc) - except json.JSONDecodeError, e: + except json.JSONDecodeError: + e = sys.exc_info()[1] self.assertEquals(e.pos, 1) self.assertEquals(e.lineno, 1) self.assertEquals(e.colno, 1) - except Exception, e: + except Exception: + e = sys.exc_info()[1] self.fail("Unexpected exception raised %r %s" % (e, e)) else: - self.fail("Unexpected success parsing '[,]'")
\ No newline at end of file + self.fail("Unexpected success parsing '[,]'") |