mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-07 05:05:01 +00:00
refactor: rename and simplify parent process name retrieval function
This commit is contained in:
parent
cb42464676
commit
e5ff5eff75
1 changed files with 2 additions and 3 deletions
|
@ -6,7 +6,6 @@ import sys
|
|||
from io import BytesIO
|
||||
|
||||
import pexpect
|
||||
import psutil
|
||||
|
||||
|
||||
def run_cmd(command, verbose=False, error_print=None):
|
||||
|
@ -24,7 +23,7 @@ def run_cmd(command, verbose=False, error_print=None):
|
|||
return 1, error_message
|
||||
|
||||
|
||||
def get_parent_process_name():
|
||||
def get_windows_parent_process_name():
|
||||
try:
|
||||
if platform.system() == "Windows":
|
||||
kernel32 = ctypes.windll.kernel32
|
||||
|
@ -37,7 +36,7 @@ def get_parent_process_name():
|
|||
return os.path.basename(exe_path.value).lower()
|
||||
else:
|
||||
return psutil.Process(os.getppid()).name().lower()
|
||||
except:
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue