[pypy-svn] r15212 - pypy/dist/pypy/module/__builtin__

arigo at codespeak.net arigo at codespeak.net
Wed Jul 27 22:10:08 CEST 2005


Author: arigo
Date: Wed Jul 27 22:10:06 2005
New Revision: 15212

Modified:
   pypy/dist/pypy/module/__builtin__/importing.py
Log:
Don't write pyc files that have the executable bit set :-)


Modified: pypy/dist/pypy/module/__builtin__/importing.py
==============================================================================
--- pypy/dist/pypy/module/__builtin__/importing.py	(original)
+++ pypy/dist/pypy/module/__builtin__/importing.py	Wed Jul 27 22:10:06 2005
@@ -96,11 +96,11 @@
     e = None
     if modtype == PYFILE:
         filename = filepart + ".py"
-        fd = os.open(filename, os.O_RDONLY, 0777)
+        fd = os.open(filename, os.O_RDONLY, 0666)
     else:
         assert modtype == PYCFILE
         filename = filepart + ".pyc"
-        fd = os.open(filename, BIN_READMASK, 0777)
+        fd = os.open(filename, BIN_READMASK, 0666)
 
     space.sys.setmodule(w_mod)
     space.setattr(w_mod, w('__file__'), space.wrap(filename))
@@ -403,7 +403,7 @@
     the header; if not, return NULL.
     Doesn't set an exception.
     """
-    fd = os.open(cpathname, BIN_READMASK, 0777) # using no defaults
+    fd = os.open(cpathname, BIN_READMASK, 0666) # using no defaults
     osfile = OsFileWrapper(fd)
     magic = _r_long(osfile)
     try:
@@ -445,7 +445,6 @@
     if magic != pyc_magic:
         raise OperationError(space.w_ImportError, w(
             "Bad magic number in %s" % cpathname))
-        return NULL;
     _r_long(osfile) # skip time stamp
     code_w = read_compiled_module(space, cpathname, osfile)
     #if (Py_VerboseFlag)
@@ -475,7 +474,7 @@
         return
     else:
         print "indeed writing", cpathname
-    fd = os.open(cpathname, BIN_WRITEMASK, 0777)
+    fd = os.open(cpathname, BIN_WRITEMASK, 0666)
     osfile = OsFileWrapper(fd)
     _w_long(osfile, pyc_magic)
     _w_long(osfile, mtime)



More information about the Pypy-commit mailing list