Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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
Karen Tracey authored June 04, 2011

Showing 1 changed file with 7 additions and 1 deletion. Show diff stats Hide diff stats

  1. 8  django/utils/autoreload.py
8  django/utils/autoreload.py
@@ -28,7 +28,7 @@
28 28
 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 29
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 30
 
31  
-import os, sys, time
  31
+import os, sys, time, signal
32 32
 
33 33
 try:
34 34
     import thread
@@ -78,7 +78,13 @@ def ensure_echo_on():
78 78
             attr_list = termios.tcgetattr(fd)
79 79
             if not attr_list[3] & termios.ECHO:
80 80
                 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
81 85
                 termios.tcsetattr(fd, termios.TCSANOW, attr_list)
  86
+                if old_handler is not None:
  87
+                    signal.signal(signal.SIGTTOU, old_handler)
82 88
 
83 89
 def reloader_thread():
84 90
     ensure_echo_on()

0 notes on commit c1baaa8

Please sign in to comment.
Something went wrong with that request. Please try again.