Changeset - 71fc1c98e02a
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2012-07-07 19:35:18
marcin@python-works.com
dont format errors to string in subprocessio
1 file changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/subprocessio.py
Show inline comments
 
@@ -358,36 +358,38 @@ class SubprocessIOChunker(object):
 
        # at this point it's still ambiguous if we are done reading or just full buffer.
 
        # Either way, if error (returned by ended process, or implied based on
 
        # presence of stuff in stderr output) we error out.
 
        # Else, we are happy.
 
        _returncode = _p.poll()
 
        if _returncode or (_returncode == None and bg_err.length):
 
            try:
 
                _p.terminate()
 
            except:
 
                pass
 
            bg_out.stop()
 
            bg_err.stop()
 
            raise EnvironmentError("Subprocess exited due to an error.\n" + "".join(bg_err))
 
            err = '%r' % ''.join(bg_err)
 
            raise EnvironmentError("Subprocess exited due to an error.\n" + err)
 

	
 
        self.process = _p
 
        self.output = bg_out
 
        self.error = bg_err
 

	
 
    def __iter__(self):
 
        return self
 

	
 
    def next(self):
 
        if self.process.poll():
 
            raise EnvironmentError("Subprocess exited due to an error:\n" + ''.join(self.error))
 
            err = '%r' % ''.join(self.error)
 
            raise EnvironmentError("Subprocess exited due to an error:\n" + err)
 
        return self.output.next()
 

	
 
    def throw(self, type, value=None, traceback=None):
 
        if self.output.length or not self.output.done_reading:
 
            raise type(value)
 

	
 
    def close(self):
 
        try:
 
            self.process.terminate()
 
        except:
 
            pass
 
        try:
0 comments (0 inline, 0 general)