From cf82fa6f919b4e5a48d25f5c99c30ae9363b2508 Mon Sep 17 00:00:00 2001 From: Florent Xicluna Date: Sun, 21 Mar 2010 12:27:20 +0000 Subject: Issue #8179: Fix macpath.realpath() on a non-existing path. --- Lib/macpath.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Lib/macpath.py') diff --git a/Lib/macpath.py b/Lib/macpath.py index 15714c6c2c..b22759efc3 100644 --- a/Lib/macpath.py +++ b/Lib/macpath.py @@ -206,7 +206,10 @@ def realpath(path): path = components[0] + ':' for c in components[1:]: path = join(path, c) - path = Carbon.File.FSResolveAliasFile(path, 1)[0].as_pathname() + try: + path = Carbon.File.FSResolveAliasFile(path, 1)[0].as_pathname() + except Carbon.File.Error: + pass return path supports_unicode_filenames = False -- cgit v1.2.1