[pypy-commit] pypy Ryan-Hileman/add-support-for-zipfile-stdlib-1562420744699: add support for zipfile stdlib

lunixbochs pypy.commits at gmail.com
Thu Aug 29 04:08:20 EDT 2019


Author: Ryan Hileman <bitbucket at bochs.info>
Branch: Ryan-Hileman/add-support-for-zipfile-stdlib-1562420744699
Changeset: r97326:870bee284470
Date: 2019-07-06 13:48 +0000
http://bitbucket.org/pypy/pypy/changeset/870bee284470/

Log:	add support for zipfile stdlib

diff --git a/pypy/module/sys/initpath.py b/pypy/module/sys/initpath.py
--- a/pypy/module/sys/initpath.py
+++ b/pypy/module/sys/initpath.py
@@ -148,10 +148,14 @@
     OSError.
     """
     from pypy.module.sys.version import CPYTHON_VERSION
-    dirname = '%d' % CPYTHON_VERSION[0]
-    lib_python = os.path.join(prefix, 'lib-python')
-    python_std_lib = os.path.join(lib_python, dirname)
-    _checkdir(python_std_lib)
+    lib_pyzip = os.path.join(prefix, 'python%d%d.zip' % CPYTHON_VERSION[:2])
+    if os.path.isfile(lib_pyzip):
+        python_std_lib = lib_pyzip
+    else:
+        dirname = '%d' % CPYTHON_VERSION[0]
+        lib_python = os.path.join(prefix, 'lib-python')
+        python_std_lib = os.path.join(lib_python, dirname)
+        _checkdir(python_std_lib)
 
     lib_pypy = os.path.join(prefix, 'lib_pypy')
     _checkdir(lib_pypy)


More information about the pypy-commit mailing list