summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-04-10 22:07:43 (GMT)
committerGuido van Rossum <guido@python.org>2001-04-10 22:07:43 (GMT)
commitbceccf5f43b51d166951ea97cff086c8828b745b (patch)
tree051a8711efadb0a2c114debc509946507e65469e /Lib
parent13aa70679ef504a7517261d5c4a3a27ee9aa30c7 (diff)
downloadcpython-bceccf5f43b51d166951ea97cff086c8828b745b.zip
cpython-bceccf5f43b51d166951ea97cff086c8828b745b.tar.gz
cpython-bceccf5f43b51d166951ea97cff086c8828b745b.tar.bz2
Updated version of RISCOS support. SF patch 411213 by Dietmar Schwertberger
Diffstat (limited to 'Lib')
-rw-r--r--Lib/plat-riscos/riscospath.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/Lib/plat-riscos/riscospath.py b/Lib/plat-riscos/riscospath.py
index b83c632..a38b22c 100644
--- a/Lib/plat-riscos/riscospath.py
+++ b/Lib/plat-riscos/riscospath.py
@@ -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):