1. Pypy
  2. Untitled project
  3. pypy

Commits

Armin Rigo  committed 1c6dc3e

Pre-import a few built-in modules, because some programs actually rely
on them to be in sys.modules :-(

  • Participants
  • Parent commits 52418df
  • Branches default

Comments (0)

Files changed (1)

File lib-python/modified-2.7/site.py

View file
  • Ignore whitespace
                 "'import usercustomize' failed; use -v for traceback"
 
 
+def import_builtin_stuff():
+    """PyPy specific: pre-import a few built-in modules, because
+    some programs actually rely on them to be in sys.modules :-("""
+    import exceptions
+    if 'zipimport' in sys.builtin_module_names:
+        import zipimport
+
+
 def main():
     global ENABLE_USER_SITE
 
+    import_builtin_stuff()
     abs__file__()
     known_paths = removeduppaths()
     if (os.name == "posix" and sys.path and