Skip to content

Commit

Permalink
Merge pull request #1754 from EliahKagan/no-taskkill
Browse files Browse the repository at this point in the history
Remove unused TASKKILL fallback in AutoInterrupt
  • Loading branch information
Byron authored Dec 2, 2023
2 parents a30b3b7 + 3f21391 commit b8ee9be
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions git/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import logging
import os
import signal
from subprocess import call, Popen, PIPE, DEVNULL
from subprocess import Popen, PIPE, DEVNULL
import subprocess
import threading
from textwrap import dedent
Expand Down Expand Up @@ -544,16 +544,6 @@ def _terminate(self) -> None:
self.status = self._status_code_if_terminate or status
except OSError as ex:
log.info("Ignored error after process had died: %r", ex)
except AttributeError:
# Try Windows.
# For some reason, providing None for stdout/stderr still prints something. This is why
# we simply use the shell and redirect to nul. Slower than CreateProcess. The question
# is whether we really want to see all these messages. It's annoying no matter what.
if os.name == "nt":
call(
("TASKKILL /F /T /PID %s 2>nul 1>nul" % str(proc.pid)),
shell=True,
)
# END exception handling

def __del__(self) -> None:
Expand Down

0 comments on commit b8ee9be

Please sign in to comment.