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():
|
77 | 77 | if termios: |
78 | 78 | fd = sys.stdin |
79 | 79 | if fd.isatty(): |
80 | | attr_list = termios.tcgetattr(fd) |
| 80 | attr_list = termios.tcgetattr(fd.fileno()) |
81 | 81 | if not attr_list[3] & termios.ECHO: |
82 | 82 | attr_list[3] |= termios.ECHO |
83 | 83 | if hasattr(signal, 'SIGTTOU'): |
84 | 84 | old_handler = signal.signal(signal.SIGTTOU, signal.SIG_IGN) |
85 | 85 | else: |
86 | 86 | old_handler = None |
87 | | termios.tcsetattr(fd, termios.TCSANOW, attr_list) |
| 87 | termios.tcsetattr(fd.fileno(), termios.TCSANOW, attr_list) |
88 | 88 | if old_handler is not None: |
89 | 89 | signal.signal(signal.SIGTTOU, old_handler) |
90 | 90 | |