Patchwork D10940: run-tests: factor appdata out

login
register
mail settings
Submitter phabricator
Date July 2, 2021, 10:37 p.m.
Message ID <differential-rev-PHID-DREV-3xxk76ln3w4cl2n5igiy-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49254/
State Superseded
Headers show

Comments

phabricator - July 2, 2021, 10:37 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is a gratuitous readability change.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10940

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -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',
                     )