[pypy-commit] pypy py3k-clock_get_info: Let's try this.

marky1991 pypy.commits at gmail.com
Fri May 27 21:19:59 EDT 2016


Author: Mark Young <marky1991 at gmail.com>
Branch: py3k-clock_get_info
Changeset: r84763:359e77a154cf
Date: 2016-05-24 21:16 -0400
http://bitbucket.org/pypy/pypy/changeset/359e77a154cf/

Log:	Let's try this.

diff --git a/pypy/module/time/interp_time.py b/pypy/module/time/interp_time.py
--- a/pypy/module/time/interp_time.py
+++ b/pypy/module/time/interp_time.py
@@ -111,6 +111,13 @@
             self.n_overflow = 0
             self.last_ticks = 0
     time_state = TimeState()
+    from rpython.rlib.rdynload import GetModuleHandle, dlsym
+    hKernel32 = GetModuleHandle("KERNEL32")
+    try:
+        dlsym(hKernel32, 'GetFinalPathNameByHandleW')
+        HAS_GETTICKCOUNT64 = True
+    except KeyError:
+        HAS_GETTICKCOUNT64 = False
 
 _includes = ["time.h"]
 if _POSIX:
@@ -194,7 +201,6 @@
 
 CLOCKS_PER_SEC = cConfig.CLOCKS_PER_SEC
 HAS_CLOCK_GETTIME = cConfig.has_clock_gettime
-HAS_GETTICKCOUNT64 = cConfig.has_gettickcount64
 clock_t = cConfig.clock_t
 tm = cConfig.tm
 glob_buf = lltype.malloc(tm, flavor='raw', zero=True, immortal=True)


More information about the pypy-commit mailing list