Commit 1dc51855 authored by Karen Tracey's avatar Karen Tracey
Browse files

[1.2.X] Ensure stdin is a tty before handing it to termios, so as to prevent...

[1.2.X] Ensure stdin is a tty before handing it to termios, so as to prevent prolems when running under IDEs.

r15911 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15912 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent c5b476e2
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -73,7 +73,8 @@ def code_changed():

def ensure_echo_on():
    if termios:
        fd = sys.stdin.fileno()
        fd = sys.stdin
        if fd.isatty():
            attr_list = termios.tcgetattr(fd)
            if not attr_list[3] & termios.ECHO:
                attr_list[3] |= termios.ECHO