Skip to content

Commit

Permalink
Import psutil from NVDA itself, if running NVDA 2024.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Davis authored and Luke Davis committed May 16, 2024
1 parent 650c98d commit bfd9a4d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions addon/globalPlugins/soundSplitter/pycaw/pycaw.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@
from enum import Enum

import comtypes
from logHandler import log
import sys
if sys.version_info.major == 2:
import psutilpy2 as psutil
else:
from .. import psutil
try:
import psutil
log.debug("Imported psutil directly.")
except ModuleNotFoundError:
from .. import psutil
log.debug("Imported built-in copy of psutil.")
from comtypes import COMMETHOD, GUID, IUnknown
from comtypes.automation import VARTYPE, VT_BOOL, VT_CLSID, VT_LPWSTR, VT_UI4
from .. future.utils import python_2_unicode_compatible
Expand Down Expand Up @@ -590,7 +596,7 @@ def Process(self):
try:
self._process = psutil.Process(self.ProcessId)
except psutil.NoSuchProcess:
# for some reason GetProcessId returned an non existing pid
# for some reason GetProcessId returned a non existing pid
return None
return self._process

Expand Down
2 changes: 1 addition & 1 deletion buildVars.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _(arg):
# Translators: Long description to be shown for this add-on on add-on information from add-ons manager
"addon_description": _("Splits sound from NvDA screen reader and other programs to separate channels"),
# version
"addon_version": "24.0.501",
"addon_version": "24.0.502",
# Author(s)
"addon_author": "Luke Davis <XLTechie@newanswertech.com>, Joseph Lee <joseph.lee22590@gmail.com>",
# URL for the add-on documentation support
Expand Down

0 comments on commit bfd9a4d

Please sign in to comment.