[pypy-commit] pypy win32-fixes5: close branch to be merged
Author: mattip Branch: win32-fixes5 Changeset: r73752:0a9b8849b6a1 Date: 2014-10-01 19:04 +0300 http://bitbucket.org/pypy/pypy/changeset/0a9b8849b6a1/ Log:close branch to be merged ___ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit
[pypy-commit] pypy default: pep-8
Author: mattip Branch: Changeset: r73755:2c8357513799 Date: 2014-10-01 19:11 +0300 http://bitbucket.org/pypy/pypy/changeset/2c8357513799/ Log:pep-8 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 @@ -25,7 +25,7 @@ break else: assert False, 'could not find cmd.exe' -else: +else: pypy_c.write("#!/bin/sh") pypy_c.chmod(0755) fake_pypy_c = True @@ -125,7 +125,7 @@ if sys.platform == 'win32': for p in [join(basedir, r'..\..\..\local'), #buildbot join(basedir, r'..\local')]: # pypy/doc/windows.rst -if exists(p): +if exists(p): license_base = p break else: ___ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit
[pypy-commit] pypy default: skip test of disabled license generation
Author: mattip Branch: Changeset: r73754:111c8c9b6897 Date: 2014-10-01 19:10 +0300 http://bitbucket.org/pypy/pypy/changeset/111c8c9b6897/ Log:skip test of disabled license generation 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,6 +115,7 @@ check(pypy, 0755) def test_generate_license(): +py.test.skip('generation of license from platform documentation is disabled') from os.path import dirname, abspath, join, exists class Options(object): pass ___ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit
[pypy-commit] pypy win32-fixes5: document branch
Author: mattip Branch: win32-fixes5 Changeset: r73751:af04bd14990f Date: 2014-10-01 19:04 +0300 http://bitbucket.org/pypy/pypy/changeset/af04bd14990f/ Log:document branch diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst --- a/pypy/doc/whatsnew-head.rst +++ b/pypy/doc/whatsnew-head.rst @@ -6,3 +6,9 @@ .. this is a revision shortly after release-2.4.x .. startrev: 7026746cbb1b +.. branch: win32-fixes5 +Fix c code generation for msvc so empty "{ }" are avoided in unions, +Avoid re-opening files created with NamedTemporaryFile, +Allocate by 4-byte chunks in rffi_platform, +Skip testing objdump if it does not exist, +and other small adjustments in own tests ___ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit
[pypy-commit] pypy default: merge win32-fixes5, which fixes own test failures in rpython/translator
Author: mattip Branch: Changeset: r73753:7c925baed944 Date: 2014-10-01 19:08 +0300 http://bitbucket.org/pypy/pypy/changeset/7c925baed944/ Log:merge win32-fixes5, which fixes own test failures in rpython/translator and win32 now rounds to 4 on rffi memory size calculation diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst --- a/pypy/doc/whatsnew-head.rst +++ b/pypy/doc/whatsnew-head.rst @@ -6,3 +6,9 @@ .. this is a revision shortly after release-2.4.x .. startrev: 7026746cbb1b +.. branch: win32-fixes5 +Fix c code generation for msvc so empty "{ }" are avoided in unions, +Avoid re-opening files created with NamedTemporaryFile, +Allocate by 4-byte chunks in rffi_platform, +Skip testing objdump if it does not exist, +and other small adjustments in own tests diff --git a/pypy/tool/gdb_pypy.py b/pypy/tool/gdb_pypy.py --- a/pypy/tool/gdb_pypy.py +++ b/pypy/tool/gdb_pypy.py @@ -123,11 +123,15 @@ vname = 'pypy_g_rpython_memory_gctypelayout_GCData.gcd_inst_typeids_z' length = int(self.gdb.parse_and_eval('*(long*)%s' % vname)) vstart = '(char*)(((long*)%s)+1)' % vname -with tempfile.NamedTemporaryFile('rb') as fobj: +fname = tempfile.mktemp() +try: self.gdb.execute('dump binary memory %s %s %s+%d' % - (fobj.name, vstart, vstart, length)) -data = fobj.read() -return TypeIdsMap(zlib.decompress(data).splitlines(True), self.gdb) + (fname, vstart, vstart, length)) +with open(fname, 'rt') as fobj: +data = fobj.read() +return TypeIdsMap(zlib.decompress(data).splitlines(True), self.gdb) +finally: +os.remove(fname) class TypeIdsMap(object): diff --git a/rpython/rtyper/module/test/test_ll_os_stat.py b/rpython/rtyper/module/test/test_ll_os_stat.py --- a/rpython/rtyper/module/test/test_ll_os_stat.py +++ b/rpython/rtyper/module/test/test_ll_os_stat.py @@ -22,10 +22,10 @@ stat = ll_os_stat.make_win32_stat_impl('stat', ll_os.StringTraits()) wstat = ll_os_stat.make_win32_stat_impl('stat', ll_os.UnicodeTraits()) def check(f): -# msec resolution +# msec resolution, +- rounding error expected = int(os.stat(f).st_mtime*1000) -assert int(stat(f).st_mtime*1000) == expected -assert int(wstat(unicode(f)).st_mtime*1000) == expected +assert abs(int(stat(f).st_mtime*1000) - expected) < 2 +assert abs(int(wstat(unicode(f)).st_mtime*1000) - expected) < 2 check('c:/') check(os.environ['TEMP']) diff --git a/rpython/rtyper/tool/rffi_platform.py b/rpython/rtyper/tool/rffi_platform.py --- a/rpython/rtyper/tool/rffi_platform.py +++ b/rpython/rtyper/tool/rffi_platform.py @@ -107,15 +107,18 @@ fields is properly aligned.""" global _memory_alignment if _memory_alignment is None: -S = getstruct('struct memory_alignment_test', """ - struct memory_alignment_test { - double d; - void* p; - }; -""", []) -result = S._hints['align'] -assert result & (result-1) == 0, "not a power of two??" -_memory_alignment = result +if sys.platform == 'win32': +_memory_alignment = 4 +else: +S = getstruct('struct memory_alignment_test', """ + struct memory_alignment_test { + double d; + void* p; + }; +""", []) +result = S._hints['align'] +assert result & (result-1) == 0, "not a power of two??" +_memory_alignment = result return _memory_alignment _memory_alignment = None diff --git a/rpython/tool/jitlogparser/test/test_parser.py b/rpython/tool/jitlogparser/test/test_parser.py --- a/rpython/tool/jitlogparser/test/test_parser.py +++ b/rpython/tool/jitlogparser/test/test_parser.py @@ -5,6 +5,7 @@ from rpython.tool.jitlogparser.storage import LoopStorage import py, sys from rpython.jit.backend.detect_cpu import autodetect +from rpython.jit.backend.tool.viewcode import ObjdumpNotFound def parse(input, **kwds): return SimpleParser.parse_from_input(input, **kwds) @@ -193,7 +194,8 @@ py.test.skip('x86 only test') backend_dump = "554889E5534154415541564157488DA5488B042590C5540148C7042590C5540148898570FF488B042598C5540148C7042598C5540148898568FF488B0425A0C5540148C70425A0C5540148898560FF488B0425A8C5540148C70425A8C5540148898558FF4C8B3C2550525B0149BB30E06C96FC7F4D8B334983C60149BB30E06C96FC7F4D89334981FF10270F8D4983C7014C8B342580F76A024983EE014C89342580F76A024983FE000F8CE9AEFF488B042588F76A024829E0483B042580EC3C01760D49BB05F30894FC7F41FFD3554889E5534154415541564157488DA550FF4889BD70FF4889B568FF48899560FF48898D58FF4D89
[pypy-commit] pypy default: random trailing whitespace clean up
Author: Alex Gaynor Branch: Changeset: r73756:9a4cb1502f11 Date: 2014-10-01 11:56 -0700 http://bitbucket.org/pypy/pypy/changeset/9a4cb1502f11/ Log:random trailing whitespace clean up diff --git a/rpython/rtyper/tool/rffi_platform.py b/rpython/rtyper/tool/rffi_platform.py --- a/rpython/rtyper/tool/rffi_platform.py +++ b/rpython/rtyper/tool/rffi_platform.py @@ -88,11 +88,11 @@ _compilation_info_ = eci WORKS = Works() configure(CConfig) - + def checkcompiles(expression, c_header_source, include_dirs=None): """Check if expression compiles. If not, returns False""" return has(expression, c_header_source, include_dirs) - + def sizeof(name, eci, **kwds): class CConfig: _compilation_info_ = eci @@ -109,7 +109,7 @@ if _memory_alignment is None: if sys.platform == 'win32': _memory_alignment = 4 -else: +else: S = getstruct('struct memory_alignment_test', """ struct memory_alignment_test { double d; @@ -132,7 +132,7 @@ self.result = {} self.info = info self.entries = entries - + def get_entry_result(self, entry): try: return self.result[entry] @@ -216,7 +216,6 @@ for key, entry in entries: writer.write_entry(key, entry) -f = writer.f writer.start_main() for key, entry in entries: writer.write_entry_main(key) @@ -361,7 +360,7 @@ self.name = name self.ctype_hint = ctype_hint self.ifdef = ifdef - + def prepare_code(self): if self.ifdef is not None: yield '#ifdef %s' % (self.ifdef,) @@ -540,7 +539,7 @@ class Has(CConfigSingleEntry): def __init__(self, name): self.name = name - + def question(self, ask_gcc): try: ask_gcc(self.name + ';') @@ -772,7 +771,7 @@ On Windows, various configurations may be tried to compile the given eci object. These configurations are a list of dicts, containing: - + - prefix: if an absolute path, will prefix each include and library directories. If a relative path, the external directory is searched for directories which names start @@ -780,13 +779,13 @@ chosen, and becomes the prefix. - include_dir: prefix + include_dir is added to the include directories - + - library_dir: prefix + library_dir is added to the library directories """ if sys.platform != 'win32': configurations = [] - + key = (name, eci) try: return _cache[key] @@ -852,7 +851,7 @@ # since config_external_library does not use a platform kwarg, # somehow using a platform kw arg make the merge fail in # config_external_library -platform = None +platform = None else: library_dir = '' libraries = ['gc', 'dl'] @@ -869,7 +868,7 @@ if __name__ == '__main__': doc = """Example: - + rffi_platform.py -h sys/types.h -h netinet/in.h 'struct sockaddr_in' sin_port INT ___ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit