Ticket #15565: restart.diff
File restart.diff, 811 bytes (added by , 14 years ago) |
---|
-
django/utils/autoreload.py
42 42 except ImportError: 43 43 pass 44 44 45 try: 46 import termios 47 except ImportError: 48 termios = None 45 49 46 50 RUN_RELOADER = True 47 51 … … 67 71 return True 68 72 return False 69 73 74 def ensure_echo_on(): 75 if termios: 76 fd = sys.stdin.fileno() 77 attr_list = termios.tcgetattr(fd) 78 if not attr_list[3] & termios.ECHO: 79 attr_list[3] |= termios.ECHO 80 termios.tcsetattr(fd, termios.TCSANOW, attr_list) 81 70 82 def reloader_thread(): 83 ensure_echo_on() 71 84 while RUN_RELOADER: 72 85 if code_changed(): 73 86 sys.exit(3) # force reload