From e622fe3717442dc9a0b17c5287bdd0ddf5de52f3 Mon Sep 17 00:00:00 2001 From: Cyrille Bougot Date: Fri, 7 Apr 2023 15:54:39 +0200 Subject: [PATCH 1/3] Fixed a bug causing wrong deprecation warnings or errors. --- source/appModuleHandler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/appModuleHandler.py b/source/appModuleHandler.py index eb77fc1ab19..b390f1d7dea 100644 --- a/source/appModuleHandler.py +++ b/source/appModuleHandler.py @@ -1,7 +1,7 @@ # -*- coding: UTF-8 -*- # A part of NonVisual Desktop Access (NVDA) # Copyright (C) 2006-2023 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Patrick Zajda, Joseph Lee, -# Babbage B.V., Mozilla Corporation, Julien Cochuyt, Leonard de Ruijter +# Babbage B.V., Mozilla Corporation, Julien Cochuyt, Leonard de Ruijter, Cyrille Bougot # This file is covered by the GNU General Public License. # See the file COPYING for more details. @@ -48,7 +48,7 @@ # Dictionary of processID:appModule pairs used to hold the currently running modules runningTable: Dict[int, AppModule] = {} -_CORE_APP_MODULES_PATH: os.PathLike = appModules.__path__[0] +_CORE_APP_MODULES_PATH: os.PathLike = appModules.__path__[-1] _getAppModuleLock=threading.RLock() #: Notifies when another application is taking foreground. #: This allows components to react upon application switches. From 2da161787690eced25dc185fb948bca3a6cfa505 Mon Sep 17 00:00:00 2001 From: Cyrille Bougot Date: Sun, 16 Apr 2023 23:23:34 +0200 Subject: [PATCH 2/3] Make appModules path more robust. (Credit @lukaszgo1) --- source/appModuleHandler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/appModuleHandler.py b/source/appModuleHandler.py index 732998f783e..e8b65af3b8e 100644 --- a/source/appModuleHandler.py +++ b/source/appModuleHandler.py @@ -48,7 +48,7 @@ # Dictionary of processID:appModule pairs used to hold the currently running modules runningTable: Dict[int, AppModule] = {} -_CORE_APP_MODULES_PATH: os.PathLike = appModules.__path__[-1] +_CORE_APP_MODULES_PATH: os.PathLike = os.path.dirname(appModules.__spec__.origin) _getAppModuleLock=threading.RLock() #: Notifies when another application is taking foreground. #: This allows components to react upon application switches. From 1e071600b6e916638f7d0987f07711529d21add1 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Tue, 18 Apr 2023 16:05:05 +1000 Subject: [PATCH 3/3] update changes --- user_docs/en/changes.t2t | 1 + 1 file changed, 1 insertion(+) diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index a7ebd3d1f91..9961a548ac3 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -84,6 +84,7 @@ Similarly, the new ``getCompletionRoutine`` method allows you to convert a pytho - ``offsets.OffsetsTextInfo._get_boundingRects`` should now always return ``List[locationHelper.rectLTWH]`` as expected for a subclass of ``textInfos.TextInfo``. (#12424) - ``highlight-color`` is now a format field attribute. (#14610) - NVDA should more accurately determine if a logged message is coming from NVDA core. (#14812) +- NVDA will no longer log inaccurate warnings or errors about deprecated appModules. (#14806) - === Deprecations ===