[Updated] D11470: util: avoid a name-error warning in the `mmapread` exception handler
mharbison72 (Matt Harbison)
phabricator at mercurial-scm.org
Wed Sep 22 07:57:18 UTC 2021
Closed by commit rHGae79611e3115: util: avoid a name-error warning in the `mmapread` exception handler (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D11470?vs=30344&id=30362
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D11470/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D11470
AFFECTED FILES
mercurial/util.py
CHANGE DETAILS
diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -449,8 +449,8 @@
return b''
elif size is None:
size = 0
+ fd = getattr(fp, 'fileno', lambda: fp)()
try:
- fd = getattr(fp, 'fileno', lambda: fp)()
return mmap.mmap(fd, size, access=mmap.ACCESS_READ)
except ValueError:
# Empty files cannot be mmapped, but mmapread should still work. Check
To: mharbison72, #hg-reviewers, Alphare
Cc: Alphare, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210922/f1319e40/attachment-0002.html>
More information about the Mercurial-patches
mailing list