Ticket #16657: 0001-PyPy-compatibility-in-runserver-s-reload-module.patch

File 0001-PyPy-compatibility-in-runserver-s-reload-module.patch, 1.3 KB (added by anonymous, 13 years ago)
  • django/utils/autoreload.py

    From f6833a8ca4e86db64879fcd3b7087a401ef05489 Mon Sep 17 00:00:00 2001
    From: Gabriel <g2p.code+django@gmail.com>
    Date: Fri, 19 Aug 2011 12:58:19 +0200
    Subject: [PATCH] PyPy compatibility in runserver's reload module.
    
    Functions from termios should be called on a file descriptor, not a file object.
    ---
     django/utils/autoreload.py |    4 ++--
     1 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/django/utils/autoreload.py b/django/utils/autoreload.py
    index ffc60d4..3eae7d9 100644
    a b def ensure_echo_on():  
    7777    if termios:
    7878        fd = sys.stdin
    7979        if fd.isatty():
    80             attr_list = termios.tcgetattr(fd)
     80            attr_list = termios.tcgetattr(fd.fileno())
    8181            if not attr_list[3] & termios.ECHO:
    8282                attr_list[3] |= termios.ECHO
    8383                if hasattr(signal, 'SIGTTOU'):
    8484                    old_handler = signal.signal(signal.SIGTTOU, signal.SIG_IGN)
    8585                else:
    8686                    old_handler = None
    87                 termios.tcsetattr(fd, termios.TCSANOW, attr_list)
     87                termios.tcsetattr(fd.fileno(), termios.TCSANOW, attr_list)
    8888                if old_handler is not None:
    8989                    signal.signal(signal.SIGTTOU, old_handler)
    9090
Back to Top