Commits

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.

  • Participants
  • Parent commits 4ebd96f
  • Tags 4.3

Comments (0)

Files changed (1)

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