[Python-checkins] bpo-36205: Fix the rusage implementation of time.process_time() (GH-15538)
Miss Islington (bot)
webhook-mailer at python.org
Tue Aug 27 00:31:31 EDT 2019
https://github.com/python/cpython/commit/1bf672f53a83c471e6fc4599d2d5149fd6842ff2
commit: 1bf672f53a83c471e6fc4599d2d5149fd6842ff2
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-08-26T21:31:27-07:00
summary:
bpo-36205: Fix the rusage implementation of time.process_time() (GH-15538)
(cherry picked from commit 8bf5fef8737fdd12724b9340d76a4ed391c4ad8a)
Co-authored-by: vrajivk <3413293+vrajivk at users.noreply.github.com>
files:
A Misc/NEWS.d/next/Library/2019-08-27-03-53-26.bpo-36205.AfkGRl.rst
M Modules/timemodule.c
diff --git a/Misc/NEWS.d/next/Library/2019-08-27-03-53-26.bpo-36205.AfkGRl.rst b/Misc/NEWS.d/next/Library/2019-08-27-03-53-26.bpo-36205.AfkGRl.rst
new file mode 100644
index 000000000000..50cda34fbbd3
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-08-27-03-53-26.bpo-36205.AfkGRl.rst
@@ -0,0 +1 @@
+Fix the rusage implementation of time.process_time() to correctly report the sum of the system and user CPU time.
\ No newline at end of file
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 4c8e2cb2344b..0ae4fcc32364 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -1189,7 +1189,7 @@ _PyTime_GetProcessTimeWithInfo(_PyTime_t *tp, _Py_clock_info_t *info)
return -1;
}
- _PyTime_t total = utime + utime;
+ _PyTime_t total = utime + stime;
*tp = total;
return 0;
}
More information about the Python-checkins
mailing list