From 98cdea44d2e65830925f69cdee91695a3256b525 Mon Sep 17 00:00:00 2001 From: clementb49 Date: Sun, 11 Aug 2019 13:31:51 +0200 Subject: [PATCH 1/2] remove pyd file in installation folder --- source/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/installer.py b/source/installer.py index 58b4ae2f5eb..b71729cea1c 100644 --- a/source/installer.py +++ b/source/installer.py @@ -210,7 +210,7 @@ def removeOldProgramFiles(destPath): # in a newer version of NVDA. for curDestDir,subDirs,files in os.walk(destPath): for f in files: - if f.endswith((".pyc", ".pyo")): + if f.endswith((".pyc", ".pyo", ".pyd")): # This also removes compiled files from system config, # but that is fine. path=os.path.join(curDestDir, f) From fb6d1a7d855c7aab75bd47eb9f025fb60c1d3ed1 Mon Sep 17 00:00:00 2001 From: clementb49 Date: Mon, 12 Aug 2019 20:37:26 +0200 Subject: [PATCH 2/2] not remove python 3 pyd files --- source/installer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/installer.py b/source/installer.py index b71729cea1c..3cf0f3726c8 100644 --- a/source/installer.py +++ b/source/installer.py @@ -23,7 +23,7 @@ import easeOfAccess import COMRegistrationFixes import winKernel - +import importlib.machinery _wsh=None def _getWSH(): global _wsh @@ -210,7 +210,7 @@ def removeOldProgramFiles(destPath): # in a newer version of NVDA. for curDestDir,subDirs,files in os.walk(destPath): for f in files: - if f.endswith((".pyc", ".pyo", ".pyd")): + if f.endswith((".pyc", ".pyo", ".pyd")) and not f.endswith(importlib.machinery.EXTENSION_SUFFIXES[0]): # This also removes compiled files from system config, # but that is fine. path=os.path.join(curDestDir, f)