[pypy-svn] r76232 - pypy/branch/unicode_filename-2/pypy/rlib

afa at codespeak.net afa at codespeak.net
Thu Jul 15 11:30:22 CEST 2010


Author: afa
Date: Thu Jul 15 11:30:20 2010
New Revision: 76232

Modified:
   pypy/branch/unicode_filename-2/pypy/rlib/rposix.py
Log:
Keep the path where both args are raw strings


Modified: pypy/branch/unicode_filename-2/pypy/rlib/rposix.py
==============================================================================
--- pypy/branch/unicode_filename-2/pypy/rlib/rposix.py	(original)
+++ pypy/branch/unicode_filename-2/pypy/rlib/rposix.py	Thu Jul 15 11:30:20 2010
@@ -77,7 +77,10 @@
 
 @specialize.argtype(0, 1)
 def rename(path1, path2):
-    return os.rename(path1.as_bytes(), path2.as_bytes())
+    if isinstance(path1, str):
+        return os.rename(path1, path2)
+    else:
+        return os.rename(path1.as_bytes(), path2.as_bytes())
 
 @specialize.argtype(0)
 def listdir(dirname):



More information about the Pypy-commit mailing list