mirror of
https://github.com/Gallopsled/pwntools.git
synced 2026-10-12 02:02:27 +00:00
* Fix some global type hint errors Errors in global scope should be fixed before we're enabling strict mode in mypy and tackle the local problems. * Remove pwnlib.util.pairwise since it's in itertools now pairwise was added to itertools itself in 3.10. https://docs.python.org/3/library/itertools.html#itertools.pairwise
21 lines
428 B
Python
21 lines
428 B
Python
"""Improved replacements for standard functions
|
|
"""
|
|
|
|
import time as __time
|
|
|
|
|
|
def sleep(n: float) -> None:
|
|
"""sleep(n)
|
|
|
|
Replacement for :func:`time.sleep()`, which does not return if a signal is received.
|
|
|
|
Arguments:
|
|
n (float): Number of seconds to sleep.
|
|
"""
|
|
end = __time.time() + n
|
|
while True:
|
|
left = end - __time.time()
|
|
if left <= 0:
|
|
break
|
|
__time.sleep(left)
|