Commits

Maciej Fijalkowski committed b57d2be

Merge 75549 and 75547 from trunk

  • Participants
  • Parent commits 0928ad4
  • Branches 1.3.x

Comments (0)

Files changed (3)

pypy/module/cpyext/api.py

         kwds["includes"] = ['Python.h'] # this is our Python.h
 
     # Generate definitions for global structures
-    struct_file = udir.join('pypy_structs.c')
     structs = ["#include <Python.h>"]
     for name, (typ, expr) in GLOBALS.iteritems():
         if name.endswith('#'):
             structs.append('PyObject* %s = (PyObject*)&_%s;' % (name, name))
         elif typ == 'PyDateTime_CAPI*':
             structs.append('%s %s = NULL;' % (typ, name))
-    struct_file.write('\n'.join(structs))
+    struct_source = '\n'.join(structs)
 
     eci = ExternalCompilationInfo(
         include_dirs=include_dirs,
                                source_dir / "bufferobject.c",
                                source_dir / "object.c",
                                source_dir / "cobject.c",
-                               struct_file,
                                ],
-        separate_module_sources = [code],
+        separate_module_sources = [code, struct_source],
         export_symbols=export_symbols_eci,
         compile_extra=compile_extra,
         **kwds

pypy/module/sys/__init__.py

         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: 

pypy/module/sys/interp_encoding.py

     """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)