[pypy-svn] r75549 - pypy/trunk/pypy/module/sys

fijal at codespeak.net fijal at codespeak.net
Thu Jun 24 02:33:51 CEST 2010


Author: fijal
Date: Thu Jun 24 02:33:49 2010
New Revision: 75549

Modified:
   pypy/trunk/pypy/module/sys/__init__.py
   pypy/trunk/pypy/module/sys/interp_encoding.py
Log:
An attempt to move calling of getfilesystemencoding a bit after (lazily is good)
otherwise it might be too early, before sys.path is ready (patched in app_main)


Modified: pypy/trunk/pypy/module/sys/__init__.py
==============================================================================
--- pypy/trunk/pypy/module/sys/__init__.py	(original)
+++ pypy/trunk/pypy/module/sys/__init__.py	Thu Jun 24 02:33:49 2010
@@ -96,11 +96,8 @@
         if space.config.translating and not we_are_translated():
             # don't get the filesystemencoding at translation time
             assert self.filesystemencoding is None
-        else:
-            from pypy.module.sys.interp_encoding import _getfilesystemencoding
-            self.filesystemencoding = _getfilesystemencoding(space)
 
-    def getmodule(self, name): 
+    def getmodule(self, name):
         space = self.space
         w_modules = self.get('modules') 
         try: 

Modified: pypy/trunk/pypy/module/sys/interp_encoding.py
==============================================================================
--- pypy/trunk/pypy/module/sys/interp_encoding.py	(original)
+++ pypy/trunk/pypy/module/sys/interp_encoding.py	Thu Jun 24 02:33:49 2010
@@ -55,4 +55,6 @@
     """Return the encoding used to convert Unicode filenames in
     operating system filenames.
     """
+    if space.sys.filesystemencoding is None:
+        space.sys.filesystemencoding = _getfilesystemencoding(space)
     return space.wrap(space.sys.filesystemencoding)



More information about the Pypy-commit mailing list