[pypy-commit] pypy py3k: make our import tag prefix 'pypy3' to avoid clashing w/ pypy2 cffi's compiled

pjenvey noreply at buildbot.pypy.org
Mon Jun 2 02:05:19 CEST 2014


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r71799:c9e1b4b9f29c
Date: 2014-06-01 17:02 -0700
http://bitbucket.org/pypy/pypy/changeset/c9e1b4b9f29c/

Log:	make our import tag prefix 'pypy3' to avoid clashing w/ pypy2 cffi's
	compiled libs within __pycache__

diff --git a/pypy/module/imp/importing.py b/pypy/module/imp/importing.py
--- a/pypy/module/imp/importing.py
+++ b/pypy/module/imp/importing.py
@@ -32,9 +32,10 @@
 IMP_HOOK = 9
 
 SO = '.pyd' if _WIN32 else '.so'
-DEFAULT_SOABI = 'pypy-%d%d' % PYPY_VERSION[:2]
+PREFIX = 'pypy3-'
+DEFAULT_SOABI = '%s%d%d' % ((PREFIX,) + PYPY_VERSION[:2])
 
-PYC_TAG = 'pypy-%d%d' % PYPY_VERSION[:2]
+PYC_TAG = '%s%d%d' % ((PREFIX,) + PYPY_VERSION[:2])
 
 @specialize.memo()
 def get_so_extension(space):
diff --git a/pypy/module/imp/test/test_app.py b/pypy/module/imp/test/test_app.py
--- a/pypy/module/imp/test/test_app.py
+++ b/pypy/module/imp/test/test_app.py
@@ -264,4 +264,4 @@
     def test_get_tag(self):
         import imp
         import sys
-        assert imp.get_tag() == 'pypy-%d%d' % sys.pypy_version_info[0:2]
+        assert imp.get_tag() == 'pypy3-%d%d' % sys.pypy_version_info[0:2]
diff --git a/pypy/module/imp/test/test_import.py b/pypy/module/imp/test/test_import.py
--- a/pypy/module/imp/test/test_import.py
+++ b/pypy/module/imp/test/test_import.py
@@ -697,9 +697,9 @@
     def test_cache_from_source(self):
         import imp
         pycfile = imp.cache_from_source('a/b/c.py')
-        assert pycfile.startswith('a/b/__pycache__/c.pypy-')
+        assert pycfile.startswith('a/b/__pycache__/c.pypy3-')
         assert pycfile.endswith('.pyc')
-        assert imp.source_from_cache('a/b/__pycache__/c.pypy-17.pyc'
+        assert imp.source_from_cache('a/b/__pycache__/c.pypy3-17.pyc'
                                      ) == 'a/b/c.py'
         raises(ValueError, imp.source_from_cache, 'a/b/c.py')
 


More information about the pypy-commit mailing list