]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Don't sleep if msecs <= 0.
authorGuido van Rossum <guido@python.org>
Sun, 21 Apr 1991 19:31:10 +0000 (19:31 +0000)
committerGuido van Rossum <guido@python.org>
Sun, 21 Apr 1991 19:31:10 +0000 (19:31 +0000)
Lib/lib-stdwin/WindowSched.py
Lib/stdwin/WindowSched.py

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