Patchwork [Bug,6238] New: Windows: time.clock removed from python 3.8 - prevents building/running from source.

login
register
mail settings
Submitter mercurial-bugs@mercurial-scm.org
Date Dec. 9, 2019, 4:49 p.m.
Message ID <bug-6238-285@https.bz.mercurial-scm.org/>
Download mbox | patch
Permalink /patch/43659/
State Not Applicable
Headers show

Comments

mercurial-bugs@mercurial-scm.org - Dec. 9, 2019, 4:49 p.m.
https://bz.mercurial-scm.org/show_bug.cgi?id=6238

            Bug ID: 6238
           Summary: Windows: time.clock removed from python 3.8 - prevents
                    building/running from source.
           Product: Mercurial
           Version: default branch
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla@mercurial-scm.org
          Reporter: tom_hindle@sil.org
                CC: mercurial-devel@mercurial-scm.org
    Python Version: ---

Emits 'Unable to find a working hg binary to extract the version from the
repository tags'

Patched by checking for perf_counter (introduced in python 3.3) first:

Patch

diff -r 76d32a0edbc6 mercurial/util.py
--- a/mercurial/util.py Fri Dec 06 15:30:06 2019 +0100
+++ b/mercurial/util.py Mon Dec 09 14:48:29 2019 -0700
@@ -2040,15 +2040,17 @@ 
             )


+timer = None;
+if safehasattr(time, "perf_counter"):
+    timer = time.perf_counter
 if pycompat.iswindows:
     checkosfilename = checkwinfilename
-    timer = time.clock
+    if not timer:
+        timer = time.clock
 else:
     checkosfilename = platform.checkosfilename
-    timer = time.time
-
-if safehasattr(time, "perf_counter"):
-    timer = time.perf_counter
+    if not timer:
+        timer = time.time


 def makelock(info, pathname):