From fdfe9fce8ca667bba06b1b1a657f722fd9511562 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Wed, 16 Jul 2014 23:50:37 +0300 Subject: Add helpers for testing unicode disabled builds. --- Lib/test/test_support.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index e1ee3f5..695ac95 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -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. -- cgit v0.12