[Python-checkins] pythoninfo: add time.time and datetime.datetime.now (GH-5214) (#5220)
Victor Stinner
webhook-mailer at python.org
Wed Jan 17 11:58:18 EST 2018
https://github.com/python/cpython/commit/016f59a71620f5eadbc06ceb79d3d486d5da8ff3
commit: 016f59a71620f5eadbc06ceb79d3d486d5da8ff3
branch: 2.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Victor Stinner <victor.stinner at gmail.com>
date: 2018-01-17T17:58:16+01:00
summary:
pythoninfo: add time.time and datetime.datetime.now (GH-5214) (#5220)
(cherry picked from commit 7d91c0250408e202243c77c1dc9afdb321b6b32f)
files:
M Lib/test/pythoninfo.py
diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py
index 4ce06e00eb9..f40ff8d0eba 100644
--- a/Lib/test/pythoninfo.py
+++ b/Lib/test/pythoninfo.py
@@ -315,6 +315,8 @@ def collect_tkinter(info_add):
def collect_time(info_add):
import time
+ info_add('time.time', time.time())
+
attributes = (
'altzone',
'daylight',
@@ -326,7 +328,16 @@ def collect_time(info_add):
if hasattr(time, 'get_clock_info'):
for clock in ('time', 'perf_counter'):
tinfo = time.get_clock_info(clock)
- info_add('time.%s' % clock, tinfo)
+ info_add('time.get_clock_info(%s)' % clock, tinfo)
+
+
+def collect_datetime(info_add):
+ try:
+ import datetime
+ except ImportError:
+ return
+
+ info_add('datetime.datetime.now', datetime.datetime.now())
def collect_sysconfig(info_add):
@@ -497,6 +508,7 @@ def collect_info(info):
collect_sys,
collect_sysconfig,
collect_time,
+ collect_datetime,
collect_tkinter,
collect_zlib,
collect_expat,
More information about the Python-checkins
mailing list