Changeset - 659ecd26002c
[Not reviewed]
default
0 1 0
Mads Kiilerich - 5 years ago 2020-08-18 13:52:58
mads@kiilerich.com
vcs: fix subprocessio handling of hack for handling end-of-stream

Address pytype warning:
File "kallithea/lib/vcs/subprocessio.py", line 383, in __next__: No attribute 'stop' on listiterator[bytes] [attribute-error]
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/subprocessio.py
Show inline comments
 
@@ -380,23 +380,23 @@ class SubprocessIOChunker(object):
 
            if (returncode is not None # process has terminated
 
                and returncode != 0
 
            ): # and it failed
 
                self.output.stop()
 
                getattr(self.output, 'stop', lambda: None)()
 
                self.error.stop()
 
                err = ''.join(self.error)
 
                raise EnvironmentError("Subprocess exited due to an error:\n" + err)
 
        return next(self.output)
 

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

	
 
    def close(self):
 
        try:
 
            self.process.terminate()
 
            getattr(self.output, 'terminate', lambda: None)()
 
        except:
 
            pass
 
        try:
 
            self.output.close()
 
            getattr(self.output, 'close', lambda: None)()
 
        except:
 
            pass
 
        try:
0 comments (0 inline, 0 general)