37,721
社区成员
发帖
与我相关
我的任务
分享
D:\BitTorrent-4.0.3>python btdownloadheadless.py --url http://10.16.29.224/KuroKy.mp4.torrent --save
_as D:\BitTorrent-4.0.3\KuroKy.mp4
Traceback (most recent call last):
File "btdownloadheadless.py", line 21, in <module>
from signal import signal, SIGWINCH
ImportError: cannot import name SIGWINCH
_registered_sigwinch = False
def watch_sigwinch():
"""Register for SIGWINCH, once and only once."""
"""Register for SIGWINCH, once and only once.
Do nothing if the signal module is not available.
"""
global _registered_sigwinch
if not _registered_sigwinch:
if sys.platform == 'win32':
# Martin (gz) mentioned WINDOW_BUFFER_SIZE_RECORD from
# ReadConsoleInput but I've no idea how to plug that in
# the current design -- vila 20091216
try:
import signal
if getattr(signal, "SIGWINCH", None) is not None:
set_signal_handler(signal.SIGWINCH, terminal_size_changed)
except ImportError:
# python doesn't provide signal support, nothing we can do about it
pass
else:
set_signal_handler(signal.SIGWINCH, _terminal_size_changed)
_registered_sigwinch = True