[pypy-svn] r76225 - pypy/branch/unicode_filename-2/pypy/module/posix

afa at codespeak.net afa at codespeak.net
Thu Jul 15 07:27:33 CEST 2010


Author: afa
Date: Thu Jul 15 07:27:31 2010
New Revision: 76225

Modified:
   pypy/branch/unicode_filename-2/pypy/module/posix/interp_posix.py
Log:
"if sys.platform..." is not RPython


Modified: pypy/branch/unicode_filename-2/pypy/module/posix/interp_posix.py
==============================================================================
--- pypy/branch/unicode_filename-2/pypy/module/posix/interp_posix.py	(original)
+++ pypy/branch/unicode_filename-2/pypy/module/posix/interp_posix.py	Thu Jul 15 07:27:31 2010
@@ -338,16 +338,18 @@
         return space.wrap(cur)
 getcwd.unwrap_spec = [ObjSpace]
 
-def getcwdu(space):
-    """Return the current working directory as a unicode string."""
-    if sys.platform == 'win32':
+if sys.platform == 'win32':
+    def getcwdu(space):
+        """Return the current working directory as a unicode string."""
         try:
             cur = os.getcwdu()
         except OSError, e:
             raise wrap_oserror(space, e)
         else:
             return space.wrap(cur)
-    else:
+else:
+    def getcwdu(space):
+        """Return the current working directory as a unicode string."""
         filesystemencoding = space.sys.filesystemencoding
         return space.call_method(getcwd(space), 'decode',
                                  space.wrap(filesystemencoding))



More information about the Pypy-commit mailing list