[pypy-commit] pypy kill-import_from_lib_pypy: move the dump writing from the ctypes config cache to tool.lib_pypy

RonnyPfannschmidt noreply at buildbot.pypy.org
Fri Jun 29 21:34:55 CEST 2012


Author: Ronny Pfannschmidt <Ronny.Pfannschmidt at gmx.de>
Branch: kill-import_from_lib_pypy
Changeset: r55874:87755db8d523
Date: 2012-06-29 21:34 +0200
http://bitbucket.org/pypy/pypy/changeset/87755db8d523/

Log:	move the dump writing from the ctypes config cache to tool.lib_pypy

diff --git a/lib_pypy/ctypes_config_cache/locale.ctc.py b/lib_pypy/ctypes_config_cache/locale.ctc.py
--- a/lib_pypy/ctypes_config_cache/locale.ctc.py
+++ b/lib_pypy/ctypes_config_cache/locale.ctc.py
@@ -5,7 +5,6 @@
 
 from ctypes_configure.configure import (configure, ExternalCompilationInfo,
     ConstantInteger, DefinedConstantInteger, SimpleType, check_eci)
-import dumpcache
 
 # ____________________________________________________________
 
@@ -70,4 +69,3 @@
 
 config['ALL_CONSTANTS'] = tuple(_CONSTANTS)
 config['HAS_LANGINFO'] = HAS_LANGINFO
-dumpcache.dumpcache2('locale', config)
diff --git a/lib_pypy/ctypes_config_cache/resource.ctc.py b/lib_pypy/ctypes_config_cache/resource.ctc.py
--- a/lib_pypy/ctypes_config_cache/resource.ctc.py
+++ b/lib_pypy/ctypes_config_cache/resource.ctc.py
@@ -5,7 +5,6 @@
 
 
 from ctypes import sizeof
-import dumpcache
 from ctypes_configure.configure import (configure,
     ExternalCompilationInfo, ConstantInteger, DefinedConstantInteger,
     SimpleType)
@@ -59,4 +58,3 @@
         del config[key]
 
 config['ALL_CONSTANTS'] = _CONSTANTS + tuple(optional_constants)
-dumpcache.dumpcache2('resource', config)
diff --git a/lib_pypy/ctypes_config_cache/syslog.ctc.py b/lib_pypy/ctypes_config_cache/syslog.ctc.py
--- a/lib_pypy/ctypes_config_cache/syslog.ctc.py
+++ b/lib_pypy/ctypes_config_cache/syslog.ctc.py
@@ -5,7 +5,6 @@
 
 from ctypes_configure.configure import (configure,
     ExternalCompilationInfo, ConstantInteger, DefinedConstantInteger)
-import dumpcache
 
 
 _CONSTANTS = (
@@ -72,4 +71,3 @@
 all_constants = config.keys()
 all_constants.sort()
 config['ALL_CONSTANTS'] = tuple(all_constants)
-dumpcache.dumpcache2('syslog', config)
diff --git a/pypy/tool/lib_pypy.py b/pypy/tool/lib_pypy.py
--- a/pypy/tool/lib_pypy.py
+++ b/pypy/tool/lib_pypy.py
@@ -1,11 +1,13 @@
 import os
 import sys
+from functools import partial
 
 import py
 import pypy
 import pypy.module
 from pypy.module.sys.version import CPYTHON_VERSION
 
+
 from ctypes_configure import dumpcache
 from pypy.jit.backend import detect_cpu
 
@@ -49,17 +51,12 @@
 def rebuild_one(path):
     filename = str(path)
     d = {'__file__': filename}
-    #XXX: hack
-    class DumpCache:
-        @staticmethod
-        def dumpcache2(basename, config):
-            dumpcache2(basename, config, filename)
-
-    sys.modules['dumpcache'] = DumpCache()
     try:
         execfile(filename, d)
     finally:
-        del sys.modules['dumpcache']
+        base = path.basename.split('.')[0]
+        dumpcache2(base, d['config'], filename)
+
 
 def try_rebuild():
     from pypy.jit.backend import detect_cpu


More information about the pypy-commit mailing list