[Python-checkins] cpython (3.4): Issue #6598: Avoid clock wrapping around in test_make_msgid_collisions.

serhiy.storchaka python-checkins at python.org
Tue Nov 10 12:54:12 EST 2015


https://hg.python.org/cpython/rev/3c0a817ab616
changeset: 99050:3c0a817ab616
branch: 3.4
parent: 99042:385b3aaf8401
user: Serhiy Storchaka <storchaka at gmail.com>
date: Tue Nov 10 19:50:14 2015 +0200
summary:
 Issue #6598: Avoid clock wrapping around in test_make_msgid_collisions.
Use time.monotonic or time.time instead of time.clock.
files:
 Lib/test/test_email/test_email.py | 5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py
--- a/Lib/test/test_email/test_email.py
+++ b/Lib/test/test_email/test_email.py
@@ -3164,7 +3164,10 @@
 self.msgids = []
 append = self.msgids.append
 make_msgid = utils.make_msgid
- clock = time.clock
+ try:
+ clock = time.monotonic
+ except AttributeError:
+ clock = time.time
 tfin = clock() + 3.0
 while clock() < tfin:
 append(make_msgid(domain='testdomain-string'))
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /