Author: Antonio Cuni <anto.c...@gmail.com>
Branch: gc-hooks
Changeset: r94348:2ca9948f1f76
Date: 2018-04-16 11:57 +0200
http://bitbucket.org/pypy/pypy/changeset/2ca9948f1f76/

Log:    try to fix translation

diff --git a/pypy/module/__pypy__/interp_debug.py 
b/pypy/module/__pypy__/interp_debug.py
--- a/pypy/module/__pypy__/interp_debug.py
+++ b/pypy/module/__pypy__/interp_debug.py
@@ -34,8 +34,12 @@
 
 def debug_get_timestamp_unit(space):
     unit = rtimer.get_timestamp_unit()
-    try:
-        unit_str = rtimer.UNITS[unit]
-    except IndexError:
+    if unit == rtimer.UNIT_TSC:
+        unit_str = 'tsc'
+    elif unit == rtimer.UNIT_NS:
+        unit_str = 'ns'
+    elif unit == rtimer.UNIT_QUERY_PERFORMANCE_COUNTER:
+        unit_str = 'QueryPerformanceCounter'
+    else:
         unit_str = 'UNKNOWN(%d)' % unit
     return space.newtext(unit_str)
diff --git a/rpython/rlib/rtimer.py b/rpython/rlib/rtimer.py
--- a/rpython/rlib/rtimer.py
+++ b/rpython/rlib/rtimer.py
@@ -12,7 +12,6 @@
 UNIT_TSC = 0
 UNIT_NS = 1 # nanoseconds
 UNIT_QUERY_PERFORMANCE_COUNTER = 2
-UNITS = ('tsc', 'ns', 'QueryPerformanceCounter')
 
 def read_timestamp():
     # Returns a longlong on 32-bit, and a regular int on 64-bit.
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to