[Jython-checkins] jython: Re-applied patch for file extension of compiled Python classes
jim.baker
jython-checkins at python.org
Thu Mar 19 18:14:47 CET 2015
https://hg.python.org/jython/rev/57f8839eaac6
changeset: 7620:57f8839eaac6
user: Jim Baker <jim.baker at rackspace.com>
date: Thu Mar 19 11:14:34 2015 -0600
summary:
Re-applied patch for file extension of compiled Python classes
The usual .pyc -> $py.class change necessary for Jython
files:
Lib/zipfile.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -7,6 +7,8 @@
import re
import string
+_is_jython = os.name == "java"
+
try:
import zlib # We may need its compression method
crc32 = zlib.crc32
@@ -1423,7 +1425,7 @@
/python/lib/string, return (/python/lib/string.pyc, string).
"""
file_py = pathname + ".py"
- file_pyc = pathname + ".pyc"
+ file_pyc = pathname + (".pyc" if not _is_jython else "$py.class")
file_pyo = pathname + ".pyo"
if os.path.isfile(file_pyo) and \
os.stat(file_pyo).st_mtime >= os.stat(file_py).st_mtime:
--
Repository URL: https://hg.python.org/jython
More information about the Jython-checkins
mailing list