Commits

Amaury Forgeot d'Arc  committed 2f8df6e

stat.st_mode is a rffi.LONG, cast it to an int.
We could probably allow arithmetic on LONG variables instead...

  • Participants
  • Parent commits 7c0f681
  • Branches real-rffi.INT

Comments (0)

Files changed (5)

File pypy/module/_file/interp_file.py

         except OSError:
             pass
         else:
-            if (stat.S_ISDIR(st[0])):
+            if stat.S_ISDIR(int(st[0])):
                 ose = OSError(errno.EISDIR, '')
                 raise wrap_oserror_as_ioerror(self.space, ose, self.w_name)
 

File pypy/module/_io/interp_fileio.py

             st = os.fstat(self.fd)
         except OSError:
             return
-        if stat.S_ISDIR(st.st_mode):
+        if stat.S_ISDIR(int(st.st_mode)):
             self._close(space)
             raise wrap_oserror2(space, OSError(errno.EISDIR, "fstat"),
                                 w_filename, exception_name='w_IOError')

File pypy/module/imp/importing.py

         except OSError:
             pass
         else:
-            if stat.S_ISDIR(st.st_mode):
+            if stat.S_ISDIR(int(st.st_mode)):
                 raise OperationError(space.w_ImportError, space.wrap(
                     "existing directory"))
 

File pypy/module/sys/state.py

 
 def checkdir(path):
     st = os.stat(path)
-    if not stat.S_ISDIR(st[0]):
+    if not stat.S_ISDIR(int(st[0])):
         raise OSError(errno.ENOTDIR, path)
 
 

File pypy/module/zipimport/interp_zipimport.py

         except OSError:
             raise operationerrfmt(w_ZipImportError,
                 "Cannot find name %s", filename)
-        if not stat.S_ISDIR(s.st_mode):
+        if not stat.S_ISDIR(int(s.st_mode)):
             ok = True
             break
     if not ok: