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 17, 2024
1 parent f1d114a commit 5805af4
Show file tree
Hide file tree
Showing 3 changed files with 13 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.1",
"addon_version": "24.0.2",
# Author(s)
"addon_author": "Luke Davis <XLTechie@newanswertech.com>, Joseph Lee <joseph.lee22590@gmail.com>",
# URL for the add-on documentation support
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog:

### 24.0.2

* Import psutil from NVDA itself, if running NVDA 2024.2.

### 24.0.0

* Compatibility with NVDA 2024.1.
Expand Down

0 comments on commit 5805af4

Please sign in to comment.