We used to not do any formatting when stderr was non-empty. Now with Alex's error reporting, this changes, but we still want to capture stderr and print a single-line error, so that the vim does not shuffle around or flash..
On Thu, Jan 10, 2013 at 8:20 PM, Kim Gräsman <[email protected]> wrote: > On Thu, Jan 10, 2013 at 1:04 AM, Matt Beaumont-Gay <[email protected]> > wrote: > >> + > >> + offset, length = getOffsetLength(filename, line_number, line_count) > >> + with open(filename, 'r') as f: > >> + text = f.read() > >> + p = subprocess.Popen([binary, '-offset', str(offset), '-length', > str(length), > >> + '-style', style], > >> + stdout=subprocess.PIPE, stderr=subprocess.PIPE, > >> + stdin=subprocess.PIPE) > >> + stdout, stderr = p.communicate(input=text) > >> + if stderr: > >> + print stderr > > > > print >>sys.stderr, stderr > > > > Or just hook up the subprocess's stderr to our stderr? > > There's the risk of deadlock that speaks against that: > http://docs.python.org/2/library/subprocess.html#subprocess.Popen.wait > > This might be a Windows-only problem, but it's no fun to debug, trust me > :-) > > - Kim >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
