Mercurial > public > mercurial-scm > hg-stable
diff tests/test-verify-repo-operations.py @ 49313:53e9422a9b45
py3: catch FileExistsError instead of checking errno == EEXIST
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Tue, 31 May 2022 21:16:17 +0200 |
parents | 6000f5b25c9b |
children | cd788962c6d9 493034cc3265 |
line wrap: on
line diff
--- a/tests/test-verify-repo-operations.py Tue May 31 16:54:58 2022 +0200 +++ b/tests/test-verify-repo-operations.py Tue May 31 21:16:17 2022 +0200 @@ -36,7 +36,6 @@ import binascii from contextlib import contextmanager -import errno import pipes import shutil import silenttestrunner @@ -86,9 +85,8 @@ try: os.close(os.open(savefile, os.O_CREAT | os.O_EXCL | os.O_WRONLY)) break - except OSError as e: - if e.errno != errno.EEXIST: - raise + except FileExistsError: + pass assert os.path.exists(savefile) hgrc = os.path.join(".hg", "hgrc")