Author: Maciej Fijalkowski <[email protected]>
Branch:
Changeset: r73630:d020fd66e8e2
Date: 2014-09-21 10:18 +0200
http://bitbucket.org/pypy/pypy/changeset/d020fd66e8e2/
Log: merge
diff --git a/lib_pypy/_curses.py b/lib_pypy/_curses.py
--- a/lib_pypy/_curses.py
+++ b/lib_pypy/_curses.py
@@ -286,6 +286,13 @@
lib = ffi.verify("""
+#ifdef __APPLE__
+/* the following define is necessary for OS X 10.6+; without it, the
+ Apple-supplied ncurses.h sets NCURSES_OPAQUE to 1, and then Python
+ can't get at the WINDOW flags field. */
+#define NCURSES_OPAQUE 0
+#endif
+
#include <ncurses.h>
#include <panel.h>
#include <term.h>
diff --git a/pypy/doc/release-2.4.0.rst b/pypy/doc/release-2.4.0.rst
--- a/pypy/doc/release-2.4.0.rst
+++ b/pypy/doc/release-2.4.0.rst
@@ -5,7 +5,7 @@
We're pleased to announce PyPy 2.4, which contains significant performance
enhancements and bug fixes.
-You can already download the PyPy 2.4-beta1 pre-release here:
+You can download the PyPy 2.4.0 release here:
http://pypy.org/download.html
@@ -63,6 +63,8 @@
PyPy now uses Python 2.7.8 standard library.
+We fixed a memory leak in IO in the sandbox_ code
+
We welcomed more than 12 new contributors, and conducted two Google
Summer of Code projects, as well as other student projects not
directly related to Summer of Code.
@@ -105,6 +107,7 @@
.. _`whats-new`: http://doc.pypy.org/en/latest/whatsnew-2.3.1.html
.. _resolved: https://bitbucket.org/pypy/pypy/issues?status=resolved
+.. _sandbox: http://doc.pypy.org/en/latest/sandbox.html
We have further improvements on the way: rpython file handling,
numpy linalg compatibility, as well
diff --git a/pypy/module/test_lib_pypy/cffi_tests/test_zdistutils.py
b/pypy/module/test_lib_pypy/cffi_tests/test_zdistutils.py
--- a/pypy/module/test_lib_pypy/cffi_tests/test_zdistutils.py
+++ b/pypy/module/test_lib_pypy/cffi_tests/test_zdistutils.py
@@ -16,6 +16,10 @@
if distutils.ccompiler.get_default_compiler() == 'msvc':
self.lib_m = 'msvcrt'
+ def teardown_class(self):
+ if udir.isdir():
+ udir.remove()
+
def test_locate_engine_class(self):
cls = _locate_engine_class(FFI(), self.generic)
if self.generic:
diff --git a/pypy/module/test_lib_pypy/cffi_tests/test_zintegration.py
b/pypy/module/test_lib_pypy/cffi_tests/test_zintegration.py
--- a/pypy/module/test_lib_pypy/cffi_tests/test_zintegration.py
+++ b/pypy/module/test_lib_pypy/cffi_tests/test_zintegration.py
@@ -73,50 +73,55 @@
assert not os.path.exists(str(SNIPPET_DIR.join(dirname, 'lextab.py')))
assert not os.path.exists(str(SNIPPET_DIR.join(dirname, 'yacctab.py')))
-def test_infrastructure():
- run_setup_and_program('infrastructure', '''
- import snip_infrastructure
- assert snip_infrastructure.func() == 42
- ''')
+class TestZIntegration(object):
+ def teardown_class(self):
+ if udir.isdir():
+ udir.remove()
-def test_distutils_module():
- run_setup_and_program("distutils_module", '''
- import snip_basic_verify
- p = snip_basic_verify.C.getpwuid(0)
- assert snip_basic_verify.ffi.string(p.pw_name) == b"root"
- ''')
+ def test_infrastructure(self):
+ run_setup_and_program('infrastructure', '''
+ import snip_infrastructure
+ assert snip_infrastructure.func() == 42
+ ''')
-def test_distutils_package_1():
- run_setup_and_program("distutils_package_1", '''
- import snip_basic_verify1
- p = snip_basic_verify1.C.getpwuid(0)
- assert snip_basic_verify1.ffi.string(p.pw_name) == b"root"
- ''')
+ def test_distutils_module(self):
+ run_setup_and_program("distutils_module", '''
+ import snip_basic_verify
+ p = snip_basic_verify.C.getpwuid(0)
+ assert snip_basic_verify.ffi.string(p.pw_name) == b"root"
+ ''')
-def test_distutils_package_2():
- run_setup_and_program("distutils_package_2", '''
- import snip_basic_verify2
- p = snip_basic_verify2.C.getpwuid(0)
- assert snip_basic_verify2.ffi.string(p.pw_name) == b"root"
- ''')
+ def test_distutils_package_1(self):
+ run_setup_and_program("distutils_package_1", '''
+ import snip_basic_verify1
+ p = snip_basic_verify1.C.getpwuid(0)
+ assert snip_basic_verify1.ffi.string(p.pw_name) == b"root"
+ ''')
-def test_setuptools_module():
- run_setup_and_program("setuptools_module", '''
- import snip_setuptools_verify
- p = snip_setuptools_verify.C.getpwuid(0)
- assert snip_setuptools_verify.ffi.string(p.pw_name) == b"root"
- ''')
+ def test_distutils_package_2(self):
+ run_setup_and_program("distutils_package_2", '''
+ import snip_basic_verify2
+ p = snip_basic_verify2.C.getpwuid(0)
+ assert snip_basic_verify2.ffi.string(p.pw_name) == b"root"
+ ''')
-def test_setuptools_package_1():
- run_setup_and_program("setuptools_package_1", '''
- import snip_setuptools_verify1
- p = snip_setuptools_verify1.C.getpwuid(0)
- assert snip_setuptools_verify1.ffi.string(p.pw_name) == b"root"
- ''')
+ def test_setuptools_module(self):
+ run_setup_and_program("setuptools_module", '''
+ import snip_setuptools_verify
+ p = snip_setuptools_verify.C.getpwuid(0)
+ assert snip_setuptools_verify.ffi.string(p.pw_name) == b"root"
+ ''')
-def test_setuptools_package_2():
- run_setup_and_program("setuptools_package_2", '''
- import snip_setuptools_verify2
- p = snip_setuptools_verify2.C.getpwuid(0)
- assert snip_setuptools_verify2.ffi.string(p.pw_name) == b"root"
- ''')
+ def test_setuptools_package_1(self):
+ run_setup_and_program("setuptools_package_1", '''
+ import snip_setuptools_verify1
+ p = snip_setuptools_verify1.C.getpwuid(0)
+ assert snip_setuptools_verify1.ffi.string(p.pw_name) == b"root"
+ ''')
+
+ def test_setuptools_package_2(self):
+ run_setup_and_program("setuptools_package_2", '''
+ import snip_setuptools_verify2
+ p = snip_setuptools_verify2.C.getpwuid(0)
+ assert snip_setuptools_verify2.ffi.string(p.pw_name) == b"root"
+ ''')
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
@@ -297,7 +297,13 @@
argparse = imp.load_source('argparse', 'lib-python/2.7/argparse.py')
if sys.platform == 'win32':
pypy_exe = 'pypy.exe'
- license_base = os.path.join(basedir, r'..\..\..\local') # as on
buildbot YMMV
+ for p in [os.path.join(basedir, r'..\..\..\local'), #buildbot
+ os.path.join(basedir, r'..\local')]: # pypy/doc/windows.rst
+ if os.path.exists(p):
+ license_base = p
+ break
+ else:
+ license_base = 'unkown'
else:
pypy_exe = 'pypy'
license_base = '/usr/share/doc'
@@ -370,5 +376,21 @@
if __name__ == '__main__':
import sys
+ if sys.platform == 'win32':
+ # Try to avoid opeing a dialog box if one of the
+ # subprocesses causes a system error
+ import ctypes
+ winapi = ctypes.windll.kernel32
+ SetErrorMode = winapi.SetErrorMode
+ SetErrorMode.argtypes=[ctypes.c_int]
+
+ SEM_FAILCRITICALERRORS = 1
+ SEM_NOGPFAULTERRORBOX = 2
+ SEM_NOOPENFILEERRORBOX = 0x8000
+ flags = SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX |
SEM_NOOPENFILEERRORBOX
+ #Since there is no GetErrorMode, do a double Set
+ old_mode = SetErrorMode(flags)
+ SetErrorMode(old_mode | flags)
+
retval, _ = package(*sys.argv[1:])
sys.exit(retval)
diff --git a/pypy/tool/release/test/test_package.py
b/pypy/tool/release/test/test_package.py
--- a/pypy/tool/release/test/test_package.py
+++ b/pypy/tool/release/test/test_package.py
@@ -115,15 +115,21 @@
check(pypy, 0755)
def test_generate_license():
- from os.path import dirname, abspath, join
+ from os.path import dirname, abspath, join, exists
class Options(object):
pass
options = Options()
basedir = dirname(dirname(dirname(dirname(dirname(abspath(__file__))))))
options.no_tk = False
if sys.platform == 'win32':
- # as on buildbot YMMV
- options.license_base = join(basedir, r'..\..\..\local')
+ for p in [join(basedir, r'..\..\..\local'), #buildbot
+ join(basedir, r'..\local')]: # pypy/doc/windows.rst
+ if exists(p):
+ license_base = p
+ break
+ else:
+ license_base = 'unkown'
+ options.license_base = license_base
else:
options.license_base = '/usr/share/doc'
license = package.generate_license(py.path.local(basedir), options)
diff --git a/rpython/translator/driver.py b/rpython/translator/driver.py
--- a/rpython/translator/driver.py
+++ b/rpython/translator/driver.py
@@ -481,6 +481,14 @@
libname = str(newsoname.dirpath().join('python27.lib'))
shutil.copyfile(str(soname.new(ext='lib')), libname)
self.log.info("copied: %s" % (libname,))
+ # XXX TODO : replace the nonsense above with
+ # ext_to_copy = ['lib', 'pdb']
+ ext_to_copy = ['pdb',]
+ for ext in ext_to_copy:
+ name = soname.new(ext=ext)
+ newname = newexename.new(basename=soname.basename)
+ shutil.copyfile(str(name), str(newname.new(ext=ext)))
+ self.log.info("copied: %s" % (newname,))
self.c_entryp = newexename
self.log.info('usession directory: %s' % (udir,))
self.log.info("created: %s" % (self.c_entryp,))
diff --git a/rpython/translator/platform/windows.py
b/rpython/translator/platform/windows.py
--- a/rpython/translator/platform/windows.py
+++ b/rpython/translator/platform/windows.py
@@ -410,7 +410,7 @@
'int main(int argc, char* argv[]) '
'{ return $(PYPY_MAIN_FUNCTION)(argc, argv); } > $@')
m.rule('$(DEFAULT_TARGET)', ['$(TARGET)', 'main.obj'],
- ['$(CC_LINK) /nologo main.obj $(SHARED_IMPORT_LIB) /out:$@
/MANIFEST /MANIFESTFILE:$*.manifest',
+ ['$(CC_LINK) /nologo /debug main.obj $(SHARED_IMPORT_LIB)
/out:$@ /MANIFEST /MANIFESTFILE:$*.manifest',
'mt.exe -nologo -manifest $*.manifest
-outputresource:$@;1',
])
m.rule('debugmode_$(DEFAULT_TARGET)', ['debugmode_$(TARGET)',
'main.obj'],
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
@@ -55,12 +55,15 @@
src_name = udir.join('src/dydy2.exe')
dll_name = udir.join('src/pypy.dll')
lib_name = udir.join('src/pypy.lib')
+ pdb_name = udir.join('src/pypy.pdb')
src_name.ensure()
src_name.write('exe')
dll_name.ensure()
dll_name.write('dll')
lib_name.ensure()
lib_name.write('lib')
+ pdb_name.ensure()
+ pdb_name.write('pdb')
dst_name.ensure()
class CBuilder(object):
@@ -75,6 +78,8 @@
assert dst_name.new(purebasename='python27',ext='lib').read() == 'lib'
def test_shutil_copy():
+ if os.name == 'nt':
+ py.test.skip('Windows cannot copy or rename to an in-use file')
a = udir.join('file_a')
b = udir.join('file_a')
a.write('hello')
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit