[pypy-commit] pypy py3.3: Fix translation.
mjacob
noreply at buildbot.pypy.org
Tue Aug 18 12:53:39 CEST 2015
Author: Manuel Jacob <me at manueljacob.de>
Branch: py3.3
Changeset: r79034:ff829278fa73
Date: 2015-08-18 12:51 +0200
http://bitbucket.org/pypy/pypy/changeset/ff829278fa73/
Log: Fix translation.
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
@@ -786,6 +786,8 @@
return space.wrap((float(kernel_time2) + float(user_time2)) * 1e-7)
else:
+ have_times = hasattr(rposix, 'c_times')
+
def process_time(space):
if cConfig.has_clock_gettime and (
cConfig.CLOCK_PROF is not None or
@@ -806,7 +808,7 @@
if ret == 0:
return space.wrap(decode_timeval(rusage.c_ru_utime) +
decode_timeval(rusage.c_ru_stime))
- if hasattr(rposix, 'c_times'):
+ if have_times:
with lltype.scoped_alloc(rposix.TMS) as tms:
ret = rposix.c_times(tms)
if ret != -1:
diff --git a/rpython/rlib/rtime.py b/rpython/rlib/rtime.py
--- a/rpython/rlib/rtime.py
+++ b/rpython/rlib/rtime.py
@@ -167,7 +167,7 @@
c_clock_gettime = external('clock_gettime',
[lltype.Signed, lltype.Ptr(TIMESPEC)],
rffi.INT, releasegil=False)
-else:
+if need_rusage:
RUSAGE = RUSAGE
RUSAGE_SELF = RUSAGE_SELF or 0
c_getrusage = external('getrusage',
More information about the pypy-commit
mailing list