# HG changeset patch # User Pierre-Yves David # Date 2021-07-02 20:50:43 # Node ID 810022009cee20563816ed525a8aa65e50c2e425 # Parent 38f00245edb3fe87ab06c0a2425434bda27284fc run-tests: factor appdata out This is a gratuitous readability change. Differential Revision: https://phab.mercurial-scm.org/D10940 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 @@ class TestRunner(object): # 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 @@ class TestRunner(object): if vi.major == 2: scripts_dir = os.path.join( - os.environ['APPDATA'], + appdata, 'Python', 'Scripts', )