]> granicus.if.org Git - python/commitdiff
Add helpers for testing unicode disabled builds.
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 16 Jul 2014 20:50:37 +0000 (23:50 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Wed, 16 Jul 2014 20:50:37 +0000 (23:50 +0300)
Lib/test/test_support.py

index e1ee3f537ece06344053a134c4a773d24ed6ce03..695ac9534c287bf3dcd4e03f86b3569f929acd62 100644 (file)
@@ -498,13 +498,18 @@ PIPE_MAX_SIZE = 4 * 1024 * 1024 + 1
 # for a discussion of this number).
 SOCK_MAX_SIZE = 16 * 1024 * 1024 + 1
 
+is_jython = sys.platform.startswith('java')
+
 try:
     unicode
     have_unicode = True
 except NameError:
     have_unicode = False
 
-is_jython = sys.platform.startswith('java')
+requires_unicode = unittest.skipUnless(have_unicode, 'no unicode support')
+
+def u(s):
+    return unicode(s, 'unicode-escape')
 
 # FS_NONASCII: non-ASCII Unicode character encodable by
 # sys.getfilesystemencoding(), or None if there is no such character.