summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-07-21 00:15:34 (GMT)
committerGuido van Rossum <guido@python.org>2007-07-21 00:15:34 (GMT)
commitbf4806bac5697bd50e6ca41fcf6838f93ed9a511 (patch)
tree68edf9157c7064170a01606663034c65d5221928
parentb8b108f306bebf90d386f6c9d14c552f62a73746 (diff)
downloadcpython-bf4806bac5697bd50e6ca41fcf6838f93ed9a511.zip
cpython-bf4806bac5697bd50e6ca41fcf6838f93ed9a511.tar.gz
cpython-bf4806bac5697bd50e6ca41fcf6838f93ed9a511.tar.bz2
SF patch# 1757758 by Alexandre Vassalotti, fixing test_ucn.
-rw-r--r--Lib/test/test_ucn.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_ucn.py b/Lib/test/test_ucn.py
index d743656..5b8ac2a 100644
--- a/Lib/test/test_ucn.py
+++ b/Lib/test/test_ucn.py
@@ -17,7 +17,7 @@ class UnicodeNamesTest(unittest.TestCase):
# Helper that put all \N escapes inside eval'd raw strings,
# to make sure this script runs even if the compiler
# chokes on \N escapes
- res = eval(r'u"\N{%s}"' % name)
+ res = eval(r'"\N{%s}"' % name)
self.assertEqual(res, code)
return res
@@ -115,26 +115,26 @@ class UnicodeNamesTest(unittest.TestCase):
self.assertRaises(TypeError, unicodedata.lookup)
self.assertRaises(KeyError, unicodedata.lookup, 'unknown')
- def test_strict_eror_handling(self):
+ def test_strict_error_handling(self):
# bogus character name
self.assertRaises(
UnicodeError,
- str, "\\N{blah}", 'unicode-escape', 'strict'
+ str, b"\\N{blah}", 'unicode-escape', 'strict'
)
# long bogus character name
self.assertRaises(
UnicodeError,
- str, "\\N{%s}" % ("x" * 100000), 'unicode-escape', 'strict'
+ str, bytes("\\N{%s}" % ("x" * 100000)), 'unicode-escape', 'strict'
)
# missing closing brace
self.assertRaises(
UnicodeError,
- str, "\\N{SPACE", 'unicode-escape', 'strict'
+ str, b"\\N{SPACE", 'unicode-escape', 'strict'
)
# missing opening brace
self.assertRaises(
UnicodeError,
- str, "\\NSPACE", 'unicode-escape', 'strict'
+ str, b"\\NSPACE", 'unicode-escape', 'strict'
)
def test_main():