Commits

Anthony Tuininga  committed 833cf45

Include support for Python 3.2.

  • Participants
  • Parent commits 68113d3

Comments (0)

Files changed (1)

File cx_Freeze/finder.py

         module.parent = parent
         if type == imp.PY_SOURCE:
             if sys.version_info[0] >= 3:
-                import py_compile
-                encoding = py_compile.read_encoding(path, "utf-8")
+                import tokenize
+                fp = open(path, "rb")
+                encoding, lines = tokenize.detect_encoding(fp.readline)
                 fp = open(path, "U", encoding = encoding)
             codeString = fp.read()
             if codeString and codeString[-1] != "\n":