[issue2571] can cmd.py's API/docs for the use of an alternate stdin be improved?

Jack Andrews report at bugs.python.org
Thu Apr 14 16:10:50 CEST 2011


Jack Andrews <effbiae at gmail.com> added the comment:

hi guys,

this makes Cmd a bit more useful.

my use case is talking to pdb via pipe
(ie. subprocess module).  pdb doesn't 
behave very well if stdin is not a tty.


===================================================================
--- cmdpy.orig/cmd.py   2011-04-14 23:55:01.102867999 +1000
+++ cmdpy/cmd.py        2011-04-14 23:55:16.272868002 +1000
@@ -92,6 +92,8 @@
             self.stdin = stdin
         else:
             self.stdin = sys.stdin
+        if not stdin.isatty():
+            self.use_rawinput = 0
         if stdout is not None:
             self.stdout = stdout

----------
nosy: +Jack.Andrews

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2571>
_______________________________________


More information about the Python-bugs-list mailing list