Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 46572:d5d9177c0045 stable 5.7.1
localrepo: fix conversion of exceptions to strings flagged by pytype
This is the same as e571fec5b606. I assume the 3 similar uses of `bytestr` in
`__getitem__()` are OK (even though pytype also flags them), because there is
apparently test coverage for 2 of the 3 cases.
Differential Revision: https://phab.mercurial-scm.org/D10131
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 08 Mar 2021 16:55:39 -0500 |
parents | 25392c48da8a |
children | 6f4a481f182a 7e08fa9b3d13 |
comparison
equal
deleted
inserted
replaced
46571:25392c48da8a | 46572:d5d9177c0045 |
---|---|
538 if e.errno != errno.ENOENT: | 538 if e.errno != errno.ENOENT: |
539 raise | 539 raise |
540 except ValueError as e: | 540 except ValueError as e: |
541 # Can be raised on Python 3.8 when path is invalid. | 541 # Can be raised on Python 3.8 when path is invalid. |
542 raise error.Abort( | 542 raise error.Abort( |
543 _(b'invalid path %s: %s') % (path, pycompat.bytestr(e)) | 543 _(b'invalid path %s: %s') % (path, stringutil.forcebytestr(e)) |
544 ) | 544 ) |
545 | 545 |
546 raise error.RepoError(_(b'repository %s not found') % path) | 546 raise error.RepoError(_(b'repository %s not found') % path) |
547 | 547 |
548 requirements = _readrequires(hgvfs, True) | 548 requirements = _readrequires(hgvfs, True) |