mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +00:00
Updated version of RISCOS support. SF patch 411213 by Dietmar Schwertberger
This commit is contained in:
parent
13aa70679e
commit
bceccf5f43
11 changed files with 240 additions and 162 deletions
|
@ -203,21 +203,30 @@ def exists(p):
|
|||
"""
|
||||
Test whether a path exists.
|
||||
"""
|
||||
return swi.swi('OS_File', '5s;i', p)!=0
|
||||
try:
|
||||
return swi.swi('OS_File', '5s;i', p)!=0
|
||||
except swi.error:
|
||||
return 0
|
||||
|
||||
|
||||
def isdir(p):
|
||||
"""
|
||||
Is a path a directory? Includes image files.
|
||||
"""
|
||||
return swi.swi('OS_File', '5s;i', p) in [2, 3]
|
||||
try:
|
||||
return swi.swi('OS_File', '5s;i', p) in [2, 3]
|
||||
except swi.error:
|
||||
return 0
|
||||
|
||||
|
||||
def isfile(p):
|
||||
"""
|
||||
Test whether a path is a file, including image files.
|
||||
"""
|
||||
return swi.swi('OS_File', '5s;i', p) in [1, 3]
|
||||
try:
|
||||
return swi.swi('OS_File', '5s;i', p) in [1, 3]
|
||||
except swi.error:
|
||||
return 0
|
||||
|
||||
|
||||
def islink(p):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue