예제 #1
0
    def _descr_init(self, space, w_path, win32):
        path = space.unicode0_w(w_path) if win32 else space.fsencode_w(w_path)
        if not path:
            raise OperationError(space.w_ImportError,
                                 space.wrap("empty pathname"))

        # Directory should not exist
        try:
            st = rposix.stat(_WIN32Path(path) if win32 else path)
        except OSError:
            pass
        else:
            if stat.S_ISDIR(st.st_mode):
                raise OperationError(space.w_ImportError,
                                     space.wrap("existing directory"))
예제 #2
0
파일: importing.py 프로젝트: Qointum/pypy
    def _descr_init(self, space, w_path, win32):
        path = space.unicode0_w(w_path) if win32 else space.fsencode_w(w_path)
        if not path:
            raise OperationError(space.w_ImportError, space.wrap(
                "empty pathname"))

        # Directory should not exist
        try:
            st = rposix.stat(_WIN32Path(path) if win32 else path)
        except OSError:
            pass
        else:
            if stat.S_ISDIR(st.st_mode):
                raise OperationError(space.w_ImportError, space.wrap(
                    "existing directory"))
예제 #3
0
 def f():
     return rposix.stat(self.path).st_mtime
예제 #4
0
 def f():
     return rposix.stat(self.path).st_mtime