Patchwork D7677: typing: suppress a warning that mercurial.windows.checkosfilename is missing

login
register
mail settings
Submitter phabricator
Date Dec. 16, 2019, 4:13 a.m.
Message ID <differential-rev-PHID-DREV-nsdhs2vxfusbgnig6f4f-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43851/
State Superseded
Headers show

Comments

phabricator - Dec. 16, 2019, 4:13 a.m.
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




To: mharbison72, #hg-reviewers
Cc: mercurial-devel

Patch

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"):