equal
deleted
inserted
replaced
74 # because the latter started returning `False` on invalid path |
74 # because the latter started returning `False` on invalid path |
75 # exceptions starting in 3.8 and we care about handling |
75 # exceptions starting in 3.8 and we care about handling |
76 # invalid paths specially here. |
76 # invalid paths specially here. |
77 st = os.stat(path) |
77 st = os.stat(path) |
78 isfile = stat.S_ISREG(st.st_mode) |
78 isfile = stat.S_ISREG(st.st_mode) |
79 # Python 2 raises TypeError, Python 3 ValueError. |
79 except ValueError as e: |
80 except (TypeError, ValueError) as e: |
|
81 raise error.Abort( |
80 raise error.Abort( |
82 _(b'invalid path %s: %s') % (path, stringutil.forcebytestr(e)) |
81 _(b'invalid path %s: %s') % (path, stringutil.forcebytestr(e)) |
83 ) |
82 ) |
84 except OSError: |
83 except OSError: |
85 isfile = False |
84 isfile = False |