We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e6b89ea commit c764fceCopy full SHA for c764fce
python-stdlib/os-path/os/path.py
@@ -66,6 +66,13 @@ def isdir(path):
66
return False
67
68
69
+def isfile(path):
70
+ try:
71
+ return bool(os.stat(path)[0] & 0x8000)
72
+ except OSError:
73
+ return False
74
+
75
76
def expanduser(s):
77
if s == "~" or s.startswith("~/"):
78
h = os.getenv("HOME")
python-stdlib/os-path/test_path.py
@@ -20,3 +20,7 @@
20
assert isdir(dir + "/os")
21
assert not isdir(dir + "/os--")
22
assert not isdir(dir + "/test_path.py")
23
24
+assert not isfile(dir + "/os")
25
+assert isfile(dir + "/test_path.py")
26
+assert not isfile(dir + "/test_path.py--")
0 commit comments