Commits

Ronny Pfannschmidt committed 87755db

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

Comments (0)

Files changed (4)

lib_pypy/ctypes_config_cache/locale.ctc.py

 
 from ctypes_configure.configure import (configure, ExternalCompilationInfo,
     ConstantInteger, DefinedConstantInteger, SimpleType, check_eci)
-import dumpcache
 
 # ____________________________________________________________
 
 
 config['ALL_CONSTANTS'] = tuple(_CONSTANTS)
 config['HAS_LANGINFO'] = HAS_LANGINFO
-dumpcache.dumpcache2('locale', config)

lib_pypy/ctypes_config_cache/resource.ctc.py

 
 
 from ctypes import sizeof
-import dumpcache
 from ctypes_configure.configure import (configure,
     ExternalCompilationInfo, ConstantInteger, DefinedConstantInteger,
     SimpleType)
         del config[key]
 
 config['ALL_CONSTANTS'] = _CONSTANTS + tuple(optional_constants)
-dumpcache.dumpcache2('resource', config)

lib_pypy/ctypes_config_cache/syslog.ctc.py

 
 from ctypes_configure.configure import (configure,
     ExternalCompilationInfo, ConstantInteger, DefinedConstantInteger)
-import dumpcache
 
 
 _CONSTANTS = (
 all_constants = config.keys()
 all_constants.sort()
 config['ALL_CONSTANTS'] = tuple(all_constants)
-dumpcache.dumpcache2('syslog', config)

pypy/tool/lib_pypy.py

 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
 
 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