run-tests: factor appdata out
This is a gratuitous readability change.
Differential Revision: https://phab.mercurial-scm.org/D10940
--- 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',
)