From bceccf5f43b51d166951ea97cff086c8828b745b Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 10 Apr 2001 22:07:43 +0000 Subject: Updated version of RISCOS support. SF patch 411213 by Dietmar Schwertberger --- Lib/plat-riscos/riscospath.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'Lib/plat-riscos') diff --git a/Lib/plat-riscos/riscospath.py b/Lib/plat-riscos/riscospath.py index b83c632fc1..a38b22c62a 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): -- cgit v1.2.1