Don't sleep if msecs <= 0.

This commit is contained in:
Guido van Rossum 1991-04-21 19:31:10 +00:00
parent fb9149c401
commit 001fa6a20f
2 changed files with 4 additions and 2 deletions

View File

@ -22,7 +22,8 @@ def delayfunc(msecs):
# Use millisleep for very short delays or if there are no windows # Use millisleep for very short delays or if there are no windows
# #
if msecs < 100 or WindowParent.CountWindows() = 0: if msecs < 100 or WindowParent.CountWindows() = 0:
time.millisleep(msecs) if msecs > 0:
time.millisleep(msecs)
return return
# #
# Post a timer event on an arbitrary window and wait for it # Post a timer event on an arbitrary window and wait for it

View File

@ -22,7 +22,8 @@ def delayfunc(msecs):
# Use millisleep for very short delays or if there are no windows # Use millisleep for very short delays or if there are no windows
# #
if msecs < 100 or WindowParent.CountWindows() = 0: if msecs < 100 or WindowParent.CountWindows() = 0:
time.millisleep(msecs) if msecs > 0:
time.millisleep(msecs)
return return
# #
# Post a timer event on an arbitrary window and wait for it # Post a timer event on an arbitrary window and wait for it