typing: suppress a warning that mercurial.windows.checkosfilename is missing
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 15 Dec 2019 21:43:18 -0500
changeset 43889 09bcbeacedc7
parent 43888 a21a6dad4b38
child 43890 5709a9992c2a
typing: suppress a warning that mercurial.windows.checkosfilename is missing 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. Differential Revision: https://phab.mercurial-scm.org/D7677
mercurial/util.py
--- a/mercurial/util.py	Sun Dec 15 21:36:06 2019 -0500
+++ b/mercurial/util.py	Sun Dec 15 21:43:18 2019 -0500
@@ -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"):