[pypy-commit] pypy py3k-fix-strategies: merge py3k

pjenvey noreply at buildbot.pypy.org
Tue Apr 15 20:31:58 CEST 2014


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k-fix-strategies
Changeset: r70640:ebfddb606dbd
Date: 2014-04-14 15:18 -0700
http://bitbucket.org/pypy/pypy/changeset/ebfddb606dbd/

Log:	merge py3k

diff --git a/lib_pypy/_pypy_interact.py b/lib_pypy/_pypy_interact.py
--- a/lib_pypy/_pypy_interact.py
+++ b/lib_pypy/_pypy_interact.py
@@ -25,6 +25,7 @@
         except ImportError:
             pass
     #
+    run_interactive = run_simple_interactive_console
     try:
         if not os.isatty(sys.stdin.fileno()):
             # Bail out if stdin is not tty-like, as pyrepl wouldn't be happy
@@ -35,13 +36,12 @@
         if not check():
             raise ImportError
         from pyrepl.simple_interact import run_multiline_interactive_console
+        run_interactive = run_multiline_interactive_console
     except ImportError:
-        run_simple_interactive_console(mainmodule)
+        pass
     except SyntaxError:
         print("Warning: 'import pyrepl' failed with SyntaxError")
-        run_simple_interactive_console(mainmodule)
-    else:
-        run_multiline_interactive_console(mainmodule)
+    run_interactive(mainmodule)
 
 def run_simple_interactive_console(mainmodule):
     import code
diff --git a/lib_pypy/_pypy_testcapi.py b/lib_pypy/_pypy_testcapi.py
--- a/lib_pypy/_pypy_testcapi.py
+++ b/lib_pypy/_pypy_testcapi.py
@@ -53,10 +53,10 @@
     if sys.platform == 'win32':
         # XXX pyconfig.h uses a pragma to link to the import library,
         #     which is currently python3.lib
-        library = os.path.join(thisdir, '..', 'include', 'python3')
+        library = os.path.join(thisdir, '..', 'include', 'python32')
         if not os.path.exists(library + '.lib'):
             # For a local translation or nightly build
-            library = os.path.join(thisdir, '..', 'pypy', 'goal', 'python3')
+            library = os.path.join(thisdir, '..', 'pypy', 'goal', 'python32')
         assert os.path.exists(library + '.lib'),'Could not find import library "%s"' % library
         libraries = [library, 'oleaut32']
         extra_ldargs = ['/MANIFEST',  # needed for VC10
diff --git a/pypy/tool/release/package.py b/pypy/tool/release/package.py
--- a/pypy/tool/release/package.py
+++ b/pypy/tool/release/package.py
@@ -115,12 +115,22 @@
                     continue
             print "Picking %s" % p
             binaries.append((p, p.basename))
-        importlib_name = 'python27.lib'    
+        importlib_name = 'libpypy-c.lib'    
         if pypy_c.dirpath().join(importlib_name).check():
-            shutil.copyfile(str(pypy_c.dirpath().join(importlib_name)),
-                        str(pypydir.join('include/python27.lib')))
-            print "Picking %s as %s" % (pypy_c.dirpath().join(importlib_name),
-                        pypydir.join('include/python27.lib'))
+            try:
+                ver = subprocess.check_output([r'pypy\goal\pypy-c','-c',
+                                            "import sys;print(sys.version)"])
+                importlib_target = 'python%s%s.lib' % (ver[0], ver[2])
+                shutil.copyfile(str(pypy_c.dirpath().join(importlib_name)),
+                            str(pypydir.join(importlib_target)))
+                # XXX fix this, either an additional build step or rename
+                # both DLL and LIB to versioned names, like cpython
+                shutil.copyfile(str(pypy_c.dirpath().join(importlib_name)),
+                            str(pypy_c.dirpath().join(importlib_target)))
+                print "Picking %s as %s" % (pypy_c.dirpath().join(importlib_name),
+                            pypydir.join('include', importlib_target))
+            except:
+                pass
         else:
             pass
             # XXX users will complain that they cannot compile cpyext
diff --git a/rpython/tool/runsubprocess.py b/rpython/tool/runsubprocess.py
--- a/rpython/tool/runsubprocess.py
+++ b/rpython/tool/runsubprocess.py
@@ -16,6 +16,8 @@
     shell_default = True
 
 def _run(executable, args, env, cwd):   # unless overridden below
+    if sys.platform == 'win32':
+        executable = executable.replace('/','\\')
     if isinstance(args, str):
         args = str(executable) + ' ' + args
         shell = True
diff --git a/rpython/translator/driver.py b/rpython/translator/driver.py
--- a/rpython/translator/driver.py
+++ b/rpython/translator/driver.py
@@ -476,11 +476,11 @@
                 shutil_copy(str(soname), str(newsoname))
                 self.log.info("copied: %s" % (newsoname,))
                 if sys.platform == 'win32':
-                    # the import library is named python27.lib, according
-                    # to the pragma in pyconfig.h
-                    libname = str(newsoname.dirpath().join('python27.lib'))
-                    shutil.copyfile(str(soname.new(ext='lib')), libname)
-                    self.log.info("copied: %s" % (libname,))
+                    # copy the import library as well
+                    libname = soname.new(ext='lib')
+                    newlibname = newexename.new(basename=soname.basename)
+                    shutil.copyfile(str(libname), str(newlibname.new(ext='lib')))
+                    self.log.info("copied: %s" % (newlibname,))
             self.c_entryp = newexename
         self.log.info('usession directory: %s' % (udir,))
         self.log.info("created: %s" % (self.c_entryp,))
diff --git a/rpython/translator/test/test_driver.py b/rpython/translator/test/test_driver.py
--- a/rpython/translator/test/test_driver.py
+++ b/rpython/translator/test/test_driver.py
@@ -72,7 +72,7 @@
     td.create_exe()
     assert dst_name.read() == 'exe'
     assert dst_name.new(ext='dll').read() == 'dll'
-    assert dst_name.new(purebasename='python27',ext='lib').read() == 'lib'
+    assert dst_name.new(ext='lib').read() == 'lib'
 
 def test_shutil_copy():
     a = udir.join('file_a')


More information about the pypy-commit mailing list