MCPcopy
hub / github.com/django/django / ensure_echo_on

Function ensure_echo_on

django/utils/autoreload.py:93–109  ·  view source on GitHub ↗

Ensure that echo mode is enabled. Some tools such as PDB disable it which causes usability issues after reload.

()

Source from the content-addressed store, hash-verified

91
92
93def ensure_echo_on():
94 """
95 Ensure that echo mode is enabled. Some tools such as PDB disable
96 it which causes usability issues after reload.
97 """
98 if not termios or not sys.stdin.isatty():
99 return
100 attr_list = termios.tcgetattr(sys.stdin)
101 if not attr_list[3] & termios.ECHO:
102 attr_list[3] |= termios.ECHO
103 if hasattr(signal, "SIGTTOU"):
104 old_handler = signal.signal(signal.SIGTTOU, signal.SIG_IGN)
105 else:
106 old_handler = None
107 termios.tcsetattr(sys.stdin, termios.TCSANOW, attr_list)
108 if old_handler is not None:
109 signal.signal(signal.SIGTTOU, old_handler)
110
111
112def iter_all_python_module_files():

Callers 1

start_djangoFunction · 0.85

Calls 1

isattyMethod · 0.45

Tested by

no test coverage detected