changeset 47496:810022009cee

run-tests: factor appdata out This is a gratuitous readability change. Differential Revision: https://phab.mercurial-scm.org/D10940
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 02 Jul 2021 22:50:43 +0200
parents 38f00245edb3
children 50829b9149b0
files tests/run-tests.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Fri Jul 02 22:48:47 2021 +0200
+++ b/tests/run-tests.py	Fri Jul 02 22:50:43 2021 +0200
@@ -3575,9 +3575,10 @@
             # not be in PATH by default.
             extra_paths = [exedir]
             vi = sys.version_info
-            if 'APPDATA' in os.environ:
+            appdata = os.environ.get('APPDATA')
+            if appdata is not None:
                 scripts_dir = os.path.join(
-                    os.environ['APPDATA'],
+                    appdata,
                     'Python',
                     'Python%d%d' % (vi[0], vi[1]),
                     'Scripts',
@@ -3585,7 +3586,7 @@
 
                 if vi.major == 2:
                     scripts_dir = os.path.join(
-                        os.environ['APPDATA'],
+                        appdata,
                         'Python',
                         'Scripts',
                     )