Maciej Fijalkowski avatar Maciej Fijalkowski committed b57d2be

Merge 75549 and 75547 from trunk

Comments (0)

Files changed (3)


         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(
                                source_dir / "bufferobject.c",
                                source_dir / "object.c",
                                source_dir / "cobject.c",
-                               struct_file,
-        separate_module_sources = [code],
+        separate_module_sources = [code, struct_source],


         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 =
         w_modules = self.get('modules') 


     """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)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.