D7677: typing: suppress a warning that mercurial.windows.checkosfilename is missing
mharbison72 (Matt Harbison)
phabricator at mercurial-scm.org
Mon Dec 16 04:13:27 UTC 2019
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
This function is used to check filename portability everwhere, so it isn't
tucked into the windows.py module. I supposed the alternative is to move it and
then alias it in `util`. I'm guessing it was done like this to save an import.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D7677
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
@@ -2050,7 +2050,8 @@
checkosfilename = checkwinfilename
timer = time.clock
else:
- checkosfilename = platform.checkosfilename
+ # mercurial.windows doesn't have platform.checkosfilename
+ checkosfilename = platform.checkosfilename # pytype: disable=module-attr
timer = time.time
if safehasattr(time, "perf_counter"):
To: mharbison72, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list