Commit cf863062 authored by Stefan Behnel's avatar Stefan Behnel

Try to fix the time_pxd test on GitHub Actions with a sledge hammer.

parent 846ce05e
...@@ -49,16 +49,16 @@ def test_localtime(): ...@@ -49,16 +49,16 @@ def test_localtime():
ltp = time.localtime() ltp = time.localtime()
ltc = ctime.localtime() ltc = ctime.localtime()
if ltp.tm_sec != ltc.tm_sec: i = 0
while ltp.tm_sec != ltc.tm_sec:
# If the time.localtime call is just before the end of a second and the # If the time.localtime call is just before the end of a second and the
# ctime.localtime call is just after the beginning of the next second, # ctime.localtime call is just after the beginning of the next second,
# re-call. This should not occur twice in a row. # re-call. This should not occur twice in a row.
time.sleep(0.1)
ltp = time.localtime() ltp = time.localtime()
ltc = ctime.localtime() ltc = ctime.localtime()
i += 1
if ltp.tm_sec != ltc.tm_sec: if i > 10:
# or three times in a row... break
ltp = time.localtime()
ltc = ctime.localtime()
return ltp, ltc return ltp, ltc
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment