# HG changeset patch # User Pierre-Yves David # Date 1625259043 -7200 # 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 -r 38f00245edb3 -r 810022009cee tests/run-tests.py --- 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', )