[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cygwin-apps
Subject:    automake: python3.2 and py-compile
From:       "Yaakov (Cygwin/X)" <yselkowitz () users ! sourceforge ! net>
Date:       2012-06-26 8:25:07
Message-ID: 1340699107.5432.9.camel () YAAKOV04
[Download RAW message or body]

Chuck,

Starting with 3.2, python implements PEP3147[1].  The attached patch
(for automake-1.11.3) fixes py-compile wrt this.


Yaakov

[1] http://www.python.org/dev/peps/pep-3147/

["automake-py32-compile.patch" (automake-py32-compile.patch)]

--- origsrc/pygobject-3.2.2/py-compile	2012-05-14 11:54:54.000000000 -0500
+++ src/pygobject-3.2.2/py-compile	2012-06-26 03:15:44.825568500 -0500
@@ -117,7 +117,7 @@ else
 fi
 
 $PYTHON -c "
-import sys, os, py_compile
+import imp, sys, os, py_compile
 
 files = '''$files'''
 
@@ -130,12 +130,16 @@ for file in files.split():
 	    continue
     sys.stdout.write(file)
     sys.stdout.flush()
-    py_compile.compile(filepath, filepath + 'c', path)
+
+    if sys.version_info >= (3, 2, 0):
+        py_compile.compile(filepath, imp.cache_from_source(filepath), path)
+    else:
+        py_compile.compile(filepath, filepath + 'c', path)
 sys.stdout.write('\n')" || exit $?
 
 # this will fail for python < 1.5, but that doesn't matter ...
 $PYTHON -O -c "
-import sys, os, py_compile
+import imp, sys, os, py_compile
 
 files = '''$files'''
 sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n')
@@ -147,7 +151,10 @@ for file in files.split():
 	    continue
     sys.stdout.write(file)
     sys.stdout.flush()
-    py_compile.compile(filepath, filepath + 'o', path)
+    if sys.version_info >= (3, 2, 0):
+        py_compile.compile(filepath, imp.cache_from_source(filepath, False), path)
+    else:
+        py_compile.compile(filepath, filepath + 'o', path)
 sys.stdout.write('\n')" 2>/dev/null || :
 
 # Local Variables:


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic