[pypy-svn] r10516 - pypy/dist/pypy/interpreter

arigo at codespeak.net arigo at codespeak.net
Sun Apr 10 18:20:11 CEST 2005


Author: arigo
Date: Sun Apr 10 18:20:11 2005
New Revision: 10516

Modified:
   pypy/dist/pypy/interpreter/gateway.py
Log:
Don't try to reload _interplevel_cache if there is only a .pyc file left
because we thought we'd clean up the cache by getting rid of the .py file!

Also, GI_VERSION can be temporary set to None in translator/geninterplevel.py
to force a systematic cache clean-up.



Modified: pypy/dist/pypy/interpreter/gateway.py
==============================================================================
--- pypy/dist/pypy/interpreter/gateway.py	(original)
+++ pypy/dist/pypy/interpreter/gateway.py	Sun Apr 10 18:20:11 2005
@@ -577,12 +577,14 @@
         cls.cache_filename = os.path.join(os.path.dirname(__file__),
                                       "_interplevel_cache.py")
         try:
+            if not os.path.exists(cls.cache_filename):
+                raise ImportError  # don't import if only a .pyc file left!!!
             from pypy.interpreter._interplevel_cache import known_source, \
                  GI_VERSION_RENDERED
         except ImportError:
             GI_VERSION_RENDERED = 0
         from pypy.translator.geninterplevel import GI_VERSION
-        if GI_VERSION != GI_VERSION_RENDERED:        
+        if GI_VERSION != GI_VERSION_RENDERED or GI_VERSION is None:
             file(cls.cache_filename, "w").write("""
 # This file acts as a cache for code snippets which have been
 # compiled by compile_as_module().



More information about the Pypy-commit mailing list