Skip to content

Commit f467834

Browse files
committed
Ignore signal exception on AutoInterrupt destructor.
When command run as subprocess, AutoInterrupt will kill the process on destructor. However, if process already finished, it raise OSError exception. This fix just ignore OSError on os.kill.
1 parent cb68f36 commit f467834

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎git/cmd.py

+2
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ def __del__(self):
8787
# try to kill it
8888
try:
8989
os.kill(self.proc.pid, 2) # interrupt signal
90+
except OSError:
91+
pass # ignore error when process already died
9092
except AttributeError:
9193
# try windows
9294
# for some reason, providing None for stdout/stderr still prints something. This is why

0 commit comments

Comments
 (0)