autoreload.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:nameko-extras 作者: Babylonpartners 项目源码 文件源码
def _ensure_echo_on():  # pragma: no cover
    if not sys.stdin.isatty():
        return None
    file_descriptor_attrs = termios.tcgetattr(sys.stdin)
    _, _, _, lflag, _, _, _ = file_descriptor_attrs
    if not lflag & termios.ECHO:
        lflag |= termios.ECHO
        try:
            old_sig_handler = signal.signal(signal.SIGTTOU, signal.SIG_IGN)
        except AttributeError:
            old_sig_handler = None
        termios.tcsetattr(sys.stdin, termios.TCSANOW, file_descriptor_attrs)
        if old_sig_handler is not None:
            signal.signal(signal.SIGTTOU, old_sig_handler)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号