mercurial/hg.py
changeset 49301 c463f45fa114
parent 48946 642e31cb55f0
child 49305 53e9422a9b45
equal deleted inserted replaced
49300:227124098e14 49301:c463f45fa114
    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