Author: Ronan Lamy <[email protected]>
Branch: py3.5
Changeset: r93228:f8e7ad765a37
Date: 2017-12-01 02:06 +0000
http://bitbucket.org/pypy/pypy/changeset/f8e7ad765a37/

Log:    .pyo suffix is meaningless now (PEP 488)

diff --git a/pypy/interpreter/app_main.py b/pypy/interpreter/app_main.py
--- a/pypy/interpreter/app_main.py
+++ b/pypy/interpreter/app_main.py
@@ -729,7 +729,7 @@
                     SourceFileLoader, SourcelessFileLoader)
             if IS_WINDOWS:
                 filename = filename.lower()
-            if filename.endswith('.pyc') or filename.endswith('.pyo'):
+            if filename.endswith('.pyc'):
                 # We don't actually load via SourcelessFileLoader
                 # because '__main__' must not be listed inside
                 # 'importlib._bootstrap._module_locks' (it deadlocks
diff --git a/pypy/interpreter/mixedmodule.py b/pypy/interpreter/mixedmodule.py
--- a/pypy/interpreter/mixedmodule.py
+++ b/pypy/interpreter/mixedmodule.py
@@ -254,7 +254,7 @@
         assert typ == imp.PY_SOURCE
         source = file.read()
         file.close()
-        if fn.endswith('.pyc') or fn.endswith('.pyo'):
+        if fn.endswith('.pyc'):
             fn = fn[:-1]
         app = gateway.applevel(source, filename=fn, modname=appname)
         applevelcache[impbase] = app
diff --git a/pypy/module/imp/interp_imp.py b/pypy/module/imp/interp_imp.py
--- a/pypy/module/imp/interp_imp.py
+++ b/pypy/module/imp/interp_imp.py
@@ -27,7 +27,7 @@
 
 def get_tag(space):
     """get_tag() -> string
-    Return the magic tag for .pyc or .pyo files."""
+    Return the magic tag for .pyc files."""
     return space.newtext(importing.PYC_TAG)
 
 def get_file(space, w_file, filename, filemode):
diff --git a/pypy/module/imp/test/test_app.py b/pypy/module/imp/test/test_app.py
--- a/pypy/module/imp/test/test_app.py
+++ b/pypy/module/imp/test/test_app.py
@@ -85,7 +85,7 @@
                 assert suffix == '.py'
                 assert mode == 'r'
             elif type == imp.PY_COMPILED:
-                assert suffix in ('.pyc', '.pyo')
+                assert suffix == '.pyc'
                 assert mode == 'rb'
             elif type == imp.C_EXTENSION:
                 assert suffix.endswith(('.pyd', '.so'))
diff --git a/pypy/module/zipimport/interp_zipimport.py 
b/pypy/module/zipimport/interp_zipimport.py
--- a/pypy/module/zipimport/interp_zipimport.py
+++ b/pypy/module/zipimport/interp_zipimport.py
@@ -18,10 +18,8 @@
 
 ENUMERATE_EXTS = unrolling_iterable(
     [(True, True, ZIPSEP + '__init__.pyc'),
-     (True, True, ZIPSEP + '__init__.pyo'),
      (False, True, ZIPSEP + '__init__.py'),
      (True, False, '.pyc'),
-     (True, False, '.pyo'),
      (False, False, '.py')])
 
 class Cache:
diff --git a/pypy/sandbox/pypy_interact.py b/pypy/sandbox/pypy_interact.py
--- a/pypy/sandbox/pypy_interact.py
+++ b/pypy/sandbox/pypy_interact.py
@@ -46,7 +46,7 @@
         # * can access its own executable
         # * can access the pure Python libraries
         # * can access the temporary usession directory as /tmp
-        exclude = ['.pyc', '.pyo']
+        exclude = ['.pyc']
         if self.tmpdir is None:
             tmpdirnode = Dir({})
         else:
@@ -57,7 +57,7 @@
             'bin': Dir({
                 'pypy3-c': RealFile(self.executable, mode=0111),
                 'lib-python': RealDir(os.path.join(libroot, 'lib-python'),
-                                      exclude=exclude), 
+                                      exclude=exclude),
                 'lib_pypy': RealDir(os.path.join(libroot, 'lib_pypy'),
                                       exclude=exclude),
                 }),
@@ -66,7 +66,7 @@
 
 def main():
     from getopt import getopt      # and not gnu_getopt!
-    options, arguments = getopt(sys.argv[1:], 't:hv', 
+    options, arguments = getopt(sys.argv[1:], 't:hv',
                                 ['tmp=', 'heapsize=', 'timeout=', 'log=',
                                  'verbose', 'help'])
     tmpdir = None
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to