Skip to content

Commit d2059ed

Browse files
Marcos Del Sol Vivestsnoam
authored andcommitted
Fix ProcessLookupError if process finishes before we kill it (python-telegram-bot#1126)
1 parent f8a17cd commit d2059ed

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/test_inputfile.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,9 @@ def test_subprocess_pipe(self):
4040
assert in_file.mimetype == 'image/png'
4141
assert in_file.filename == 'image.png'
4242

43-
proc.kill()
43+
try:
44+
proc.kill()
45+
except ProcessLookupError:
46+
# This exception may be thrown if the process has finished before we had the chance
47+
# to kill it.
48+
pass

0 commit comments

Comments
 (0)