make stdout and stderr non buffered for cwctl commands (#1330647) stable
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
Wed, 20 Oct 2010 15:20:12 +0200
branchstable
changeset 6562 34be5986bca0
parent 6560 48ba5069e051
child 6565 e89de028d004
child 6571 71b446d1cf93
make stdout and stderr non buffered for cwctl commands (#1330647)
cwctl.py
--- a/cwctl.py	Wed Oct 20 12:28:11 2010 +0200
+++ b/cwctl.py	Wed Oct 20 15:20:12 2010 +0200
@@ -35,6 +35,7 @@
     def getpgid():
         """win32 getpgid implementation"""
 
+
 from os.path import exists, join, isfile, isdir, dirname, abspath
 
 from logilab.common.clcommands import CommandLine
@@ -952,6 +953,9 @@
 
 def run(args):
     """command line tool"""
+    import os
+    sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
+    sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0)
     cwcfg.load_cwctl_plugins()
     try:
         CWCTL.run(args)