]> granicus.if.org Git - python/commitdiff
Issue #6598: Avoid clock wrapping around in test_make_msgid_collisions.
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 10 Nov 2015 17:50:14 +0000 (19:50 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Tue, 10 Nov 2015 17:50:14 +0000 (19:50 +0200)
Use time.monotonic or time.time instead of time.clock.

Lib/test/test_email/test_email.py

index e4541fbe018cac321415538c7a4b15c60cac5455..84f4e383f914a66c3ca82da2b251d25408b6ac9b 100644 (file)
@@ -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'))