[pypy-commit] pypy py3k: simplify

pjenvey noreply at buildbot.pypy.org
Thu Mar 7 08:50:34 CET 2013


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r62158:e569a7d9ad90
Date: 2013-03-06 23:42 -0800
http://bitbucket.org/pypy/pypy/changeset/e569a7d9ad90/

Log:	simplify

diff --git a/pypy/module/imp/test/support.py b/pypy/module/imp/test/support.py
--- a/pypy/module/imp/test/support.py
+++ b/pypy/module/imp/test/support.py
@@ -10,12 +10,8 @@
         if sys.platform == 'nt':
             testfn_unencodable = testfn + u"-\u5171\u0141\u2661\u0363\uDC80"
         elif sys.platform != 'darwin':
-            fsenc = sys.getfilesystemencoding()
             try:
-                '\xff'.decode(fsenc)
+                '\xff'.decode(sys.getfilesystemencoding())
             except UnicodeDecodeError:
-                w_unenc = space.call_method(space.wrapbytes('-\xff'), 'decode',
-                                            space.wrap(fsenc),
-                                            space.wrap('surrogateescape'))
-                testfn_unencodable = testfn + space.unicode_w(w_unenc)
+                testfn_unencodable = testfn + u'-\udcff'
         cls.w_testfn_unencodable = space.wrap(testfn_unencodable)


More information about the pypy-commit mailing list