Mercurial > hg
comparison hgext/git/dirstate.py @ 49306:2e726c934fcd
py3: catch FileNotFoundError instead of checking errno == ENOENT
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Tue, 31 May 2022 22:50:01 +0200 |
parents | 020328be00cb |
children | 3c4d36a96a3e |
comparison
equal
deleted
inserted
replaced
49305:53e9422a9b45 | 49306:2e726c934fcd |
---|---|
1 import contextlib | 1 import contextlib |
2 import errno | |
3 import os | 2 import os |
4 | 3 |
5 from mercurial.node import sha1nodeconstants | 4 from mercurial.node import sha1nodeconstants |
6 from mercurial import ( | 5 from mercurial import ( |
7 dirstatemap, | 6 dirstatemap, |
316 if not match(path): | 315 if not match(path): |
317 continue | 316 continue |
318 # TODO construct the stat info from the status object? | 317 # TODO construct the stat info from the status object? |
319 try: | 318 try: |
320 s = os.stat(os.path.join(cwd, path)) | 319 s = os.stat(os.path.join(cwd, path)) |
321 except OSError as e: | 320 except FileNotFoundError: |
322 if e.errno != errno.ENOENT: | |
323 raise | |
324 continue | 321 continue |
325 r[path] = s | 322 r[path] = s |
326 return r | 323 return r |
327 | 324 |
328 def savebackup(self, tr, backupname): | 325 def savebackup(self, tr, backupname): |