summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_getargs.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/test/test_getargs.py b/Lib/test/test_getargs.py
index ed6e4ee..ff0d36c 100644
--- a/Lib/test/test_getargs.py
+++ b/Lib/test/test_getargs.py
@@ -14,8 +14,11 @@ single case that failed between 2.1 and 2.2a2.
# XXX If the encoding succeeds using the current default encoding,
# this test will fail because it does not test the right part of the
# PyArg_ParseTuple() implementation.
+from test_support import have_unicode
import marshal
-try:
- marshal.loads(u"\222")
-except UnicodeError:
- pass
+
+if have_unicode:
+ try:
+ marshal.loads(unicode(r"\222", 'unicode-escape'))
+ except UnicodeError:
+ pass