我正在使用64位Mac OS X机器上的Python 2.7.10。为什么`time.sleep()`在100000000以后会引发一个`IOError`?
在下面的例子中,`time.sleep(100000000)`可以正常工作,但是`time.sleep(100000001)`会引发`IOError`。
在下面的例子中,`time.sleep(100000000)`可以正常工作,但是`time.sleep(100000001)`会引发`IOError`。
$ python
Python 2.7.10 (default, Oct 6 2017, 22:29:07)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> time.sleep(100000000)
^CTraceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyboardInterrupt
>>>
>>>
>>> time.sleep(100000001)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IOError: [Errno 22] Invalid argument