os.path: Remove external / ffi dependencies in os.path.

This work was funded by Planet Innovation.

Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
pull/543/head
Andrew Leech 2022-09-30 17:50:21 +10:00
rodzic d0f97fc218
commit 459e13921a
2 zmienionych plików z 7 dodań i 5 usunięć

Wyświetl plik

@ -1,4 +1,4 @@
metadata(version="0.1.3")
metadata(version="0.1.4")
# Originally written by Paul Sokolovsky.

Wyświetl plik

@ -47,7 +47,11 @@ def basename(path):
def exists(path):
return os.access(path, os.F_OK)
try:
os.stat(path)
return True
except OSError:
return False
# TODO
@ -55,11 +59,9 @@ lexists = exists
def isdir(path):
import stat
try:
mode = os.stat(path)[0]
return stat.S_ISDIR(mode)
return mode & 0o040000
except OSError:
return False