public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* automake: python3.2 and py-compile
@ 2012-06-26  8:25 Yaakov (Cygwin/X)
  2012-10-17 16:07 ` Yaakov (Cygwin/X)
  0 siblings, 1 reply; 7+ messages in thread
From: Yaakov (Cygwin/X) @ 2012-06-26  8:25 UTC (permalink / raw)
  To: cygwin-apps

[-- Attachment #1: Type: text/plain, Size: 181 bytes --]

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/

[-- Attachment #2: automake-py32-compile.patch --]
[-- Type: text/x-patch, Size: 1350 bytes --]

--- 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:

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-12-04  8:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-26  8:25 automake: python3.2 and py-compile Yaakov (Cygwin/X)
2012-10-17 16:07 ` Yaakov (Cygwin/X)
2012-11-16 10:39   ` Yaakov (Cygwin/X)
2012-11-23 14:24     ` Corinna Vinschen
2012-12-04  3:03       ` Charles Wilson
2012-12-04  8:26         ` Corinna Vinschen
2012-11-25  1:54     ` Yaakov (Cygwin/X)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).