Skip to content

Commit

Permalink
[#17] The second attempt to fix the problem
Browse files Browse the repository at this point in the history
  • Loading branch information
SystemXFiles committed Mar 7, 2024
1 parent f6dbc66 commit 25b0aad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/service/services_info_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Optional

import psutil
from psutil import STATUS_STOPPED, NoSuchProcess
from psutil import STATUS_STOPPED, NoSuchProcess, ZombieProcess, AccessDenied
from psutil._pswindows import WindowsService

from constants.any import LOG
Expand All @@ -12,12 +12,12 @@
# Fix bug of psutil
WindowsService.description = suppress_exception(
WindowsService.description,
(FileNotFoundError,),
(FileNotFoundError, ZombieProcess, AccessDenied, OSError),
lambda: ""
)
WindowsService._query_config = suppress_exception(
WindowsService._query_config,
(FileNotFoundError,),
(FileNotFoundError, ZombieProcess, AccessDenied, OSError),
lambda: dict(display_name="", binpath="", username="", start_type="")
)

Expand Down

0 comments on commit 25b0aad

Please sign in to comment.