diff options
-rw-r--r-- | Lib/test/test_unary.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_unary.py b/Lib/test/test_unary.py index 0c5dd94..7161f74 100644 --- a/Lib/test/test_unary.py +++ b/Lib/test/test_unary.py @@ -1,7 +1,7 @@ """Test compiler changes for unary ops (+, -, ~) introduced in Python 2.2""" import unittest -from test_support import run_unittest +from test_support import run_unittest, have_unicode class UnaryOpTestCase(unittest.TestCase): @@ -44,7 +44,8 @@ class UnaryOpTestCase(unittest.TestCase): def test_bad_types(self): for op in '+', '-', '~': self.assertRaises(TypeError, eval, op + "'a'") - self.assertRaises(TypeError, eval, op + "u'a'") + if have_unicode: + self.assertRaises(TypeError, eval, op + "u'a'") self.assertRaises(TypeError, eval, "~2j") self.assertRaises(TypeError, eval, "~2.0") |