From e1dc3d47e0a5cc4b390cc9eb70c5a5153c309cb2 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Tue, 10 Nov 2015 19:50:14 +0200 Subject: Issue #6598: Avoid clock wrapping around in test_make_msgid_collisions. Use time.monotonic or time.time instead of time.clock. --- Lib/test/test_email/test_email.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py index e4541fb..84f4e38 100644 --- a/Lib/test/test_email/test_email.py +++ b/Lib/test/test_email/test_email.py @@ -3164,7 +3164,10 @@ Foo 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')) -- cgit v0.12