Anthony Tuininga avatar Anthony Tuininga committed 047c072

Python 3.3 requires the presence of _frozen_importlib which is generated by
a utility in Python and not exposed so the include file that contains the
code needs to be copied from the source to a location that will be found
when building cx_Freeze.

Comments (0)

Files changed (1)

cx_Freeze/finder.py

         if not os.path.isdir(dirName):
             os.makedirs(dirName)
         outfp = open(fileName, "w")
+        if sys.version_info[:2] >= (3, 3):
+            outfp.write('#include "importlib.h"\n\n')
         names = list(self._modules.keys())
         names.sort()
         modulesWritten = []
                     outfp.write("%d," % op)
             outfp.write("\n};\n\n");
         outfp.write("static struct _frozen gFrozenModules[] = {\n")
+        if sys.version_info[:2] >= (3, 3):
+            outfp.write('    {"_frozen_importlib", _Py_M__importlib, ' \
+                    '(int)sizeof(_Py_M__importlib)},\n')
         for name, mangledName, size in modulesWritten:
             outfp.write('    {"%s", M_%s, %d},\n' % (name, mangledName, size))
         outfp.write("    {0, 0, 0}\n};\n")
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 ProjectModifiedEvent.java.
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.