# HG changeset patch # User Mads Kiilerich # Date 1597751578 -7200 # Node ID 659ecd26002cc926cad2ceeb91790363b2d350c8 # Parent 43d9615facc6a6182fc4259561d015041d947f9c 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] diff -r 43d9615facc6 -r 659ecd26002c kallithea/lib/vcs/subprocessio.py --- a/kallithea/lib/vcs/subprocessio.py Mon Aug 17 14:59:07 2020 +0200 +++ b/kallithea/lib/vcs/subprocessio.py Tue Aug 18 13:52:58 2020 +0200 @@ -380,23 +380,23 @@ 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: