Commits

Philip Jenvey committed 130ac05

ensure __cached__

  • Participants
  • Parent commits 01ed12f
  • Branches py3k

Comments (0)

Files changed (2)

File pypy/interpreter/app_main.py

                                                         'exec')
                             exec_(co_python_startup, mainmodule.__dict__)
                         mainmodule.__file__ = python_startup
+                        mainmodule.__cached__ = None
                         run_toplevel(run_it)
                         try:
                             del mainmodule.__file__
                     co_stdin = compile(sys.stdin.read(), '<stdin>', 'exec')
                     exec_(co_stdin, mainmodule.__dict__)
                 mainmodule.__file__ = '<stdin>'
+                mainmodule.__cached__ = None
                 success = run_toplevel(run_it)
         else:
             # handle the common case where a filename is specified
             # on the command-line.
             filename = sys.argv[0]
             mainmodule.__file__ = filename
+            mainmodule.__cached__ = None
             sys.path.insert(0, sys.pypy_resolvedirof(filename))
             # assume it's a pyc file only if its name says so.
             # CPython goes to great lengths to detect other cases

File pypy/interpreter/test2/test_app_main.py

         print('hello')
         print('Name:', __name__)
         print('File:', __file__)
+        print('Cached:', __cached__)
         import sys
         print('Exec:', sys.executable)
         print('Argv:', sys.argv)