Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[1.3.X] Fix #15880: Prevent "stalling" when running dev server in bac…

…kground by ignoring SIGTTOU for the duration of tcsetattr.

Backport of [16326] from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.3.X@16327 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c1baaa8c8799750f66d84d9ab35ce332596107ea 1 parent f578563
@kmtracey kmtracey authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 django/utils/autoreload.py
View
8 django/utils/autoreload.py
@@ -28,7 +28,7 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-import os, sys, time
+import os, sys, time, signal
try:
import thread
@@ -78,7 +78,13 @@ def ensure_echo_on():
attr_list = termios.tcgetattr(fd)
if not attr_list[3] & termios.ECHO:
attr_list[3] |= termios.ECHO
+ if hasattr(signal, 'SIGTTOU'):
+ old_handler = signal.signal(signal.SIGTTOU, signal.SIG_IGN)
+ else:
+ old_handler = None
termios.tcsetattr(fd, termios.TCSANOW, attr_list)
+ if old_handler is not None:
+ signal.signal(signal.SIGTTOU, old_handler)
def reloader_thread():
ensure_echo_on()
Please sign in to comment.
Something went wrong with that request. Please try again.