Ticket #15880: 15880.diff

File 15880.diff, 1.0 KB (added by kmtracey, 4 years ago)
  • django/utils/autoreload.py

     
    2828# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    2929# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    3030
    31 import os, sys, time
     31import os, sys, time, signal
    3232
    3333try:
    3434    import thread
     
    7878            attr_list = termios.tcgetattr(fd)
    7979            if not attr_list[3] & termios.ECHO:
    8080                attr_list[3] |= termios.ECHO
     81                if hasattr(signal, 'SIGTTOU'):
     82                    old_handler = signal.signal(signal.SIGTTOU, signal.SIG_IGN)
     83                else:
     84                    old_handler = None
    8185                termios.tcsetattr(fd, termios.TCSANOW, attr_list)
     86                if old_handler is not None:
     87                    signal.signal(signal.SIGTTOU, old_handler)
    8288
    8389def reloader_thread():
    8490    ensure_echo_on()
Back to Top