From: Serhiy Storchaka Date: Tue, 10 Nov 2015 17:50:14 +0000 (+0200) Subject: Issue #6598: Avoid clock wrapping around in test_make_msgid_collisions. X-Git-Tag: v3.5.1rc1~64^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e1dc3d47e0a5cc4b390cc9eb70c5a5153c309cb2;p=python Issue #6598: Avoid clock wrapping around in test_make_msgid_collisions. Use time.monotonic or time.time instead of time.clock. --- diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py index e4541fbe01..84f4e383f9 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'))