From patchwork Fri Jul 2 22:37:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D10940: run-tests: factor appdata out From: phabricator X-Patchwork-Id: 49254 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Fri, 2 Jul 2021 22:37:52 +0000 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 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', )