|
|
c2f9c4d |
commit 7b0a3fd85beb67c990da3fb1b690444a27a6ee42
|
|
|
c2f9c4d |
Author: Tom Hughes <tom@compton.nu>
|
|
|
c2f9c4d |
Date: Fri Aug 23 09:33:14 2019 +0100
|
|
|
c2f9c4d |
|
|
|
c2f9c4d |
Fix python 3.8 warnings
|
|
|
c2f9c4d |
|
|
|
c2f9c4d |
diff --git a/pylib/gyp/input.py b/pylib/gyp/input.py
|
|
|
c2f9c4d |
index 42c279cf..013231dc 100644
|
|
|
c2f9c4d |
--- a/pylib/gyp/input.py
|
|
|
c2f9c4d |
+++ b/pylib/gyp/input.py
|
|
|
c2f9c4d |
@@ -1181,7 +1181,7 @@ def LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key):
|
|
|
c2f9c4d |
if variable_name in variables:
|
|
|
c2f9c4d |
# If the variable is already set, don't set it.
|
|
|
c2f9c4d |
continue
|
|
|
c2f9c4d |
- if the_dict_key is 'variables' and variable_name in the_dict:
|
|
|
c2f9c4d |
+ if the_dict_key == 'variables' and variable_name in the_dict:
|
|
|
c2f9c4d |
# If the variable is set without a % in the_dict, and the_dict is a
|
|
|
c2f9c4d |
# variables dict (making |variables| a varaibles sub-dict of a
|
|
|
c2f9c4d |
# variables dict), use the_dict's definition.
|
|
|
c2f9c4d |
diff --git a/test/lib/TestCmd.py b/test/lib/TestCmd.py
|
|
|
c2f9c4d |
index 1ec50933..457694c8 100644
|
|
|
c2f9c4d |
--- a/test/lib/TestCmd.py
|
|
|
c2f9c4d |
+++ b/test/lib/TestCmd.py
|
|
|
c2f9c4d |
@@ -283,7 +283,7 @@ if os.name in ('posix', 'nt'):
|
|
|
c2f9c4d |
else:
|
|
|
c2f9c4d |
tempfile.template = 'testcmd.'
|
|
|
c2f9c4d |
|
|
|
c2f9c4d |
-re_space = re.compile('\s')
|
|
|
c2f9c4d |
+re_space = re.compile(r'\s')
|
|
|
c2f9c4d |
|
|
|
c2f9c4d |
_Cleanup = []
|
|
|
c2f9c4d |
|
|
|
c2f9c4d |
@@ -882,7 +882,7 @@ class TestCmd(object):
|
|
|
c2f9c4d |
#self.diff_function = difflib.unified_diff
|
|
|
c2f9c4d |
self._dirlist = []
|
|
|
c2f9c4d |
self._preserve = {'pass_test': 0, 'fail_test': 0, 'no_result': 0}
|
|
|
c2f9c4d |
- if 'PRESERVE' in os.environ and os.environ['PRESERVE'] is not '':
|
|
|
c2f9c4d |
+ if 'PRESERVE' in os.environ and os.environ['PRESERVE'] != '':
|
|
|
c2f9c4d |
self._preserve['pass_test'] = os.environ['PRESERVE']
|
|
|
c2f9c4d |
self._preserve['fail_test'] = os.environ['PRESERVE']
|
|
|
c2f9c4d |
self._preserve['no_result'] = os.environ['PRESERVE']
|
|
|
c2f9c4d |
@@ -1103,7 +1103,7 @@ class TestCmd(object):
|
|
|
c2f9c4d |
the temporary working directories to be preserved for all
|
|
|
c2f9c4d |
conditions.
|
|
|
c2f9c4d |
"""
|
|
|
c2f9c4d |
- if conditions is ():
|
|
|
c2f9c4d |
+ if len(conditions) == 0:
|
|
|
c2f9c4d |
conditions = ('pass_test', 'fail_test', 'no_result')
|
|
|
c2f9c4d |
for cond in conditions:
|
|
|
c2f9c4d |
self._preserve[cond] = 1
|
|
|
c2f9c4d |
diff --git a/test/lib/TestGyp.py b/test/lib/TestGyp.py
|
|
|
c2f9c4d |
index cba2d3cc..43865ee1 100644
|
|
|
c2f9c4d |
--- a/test/lib/TestGyp.py
|
|
|
c2f9c4d |
+++ b/test/lib/TestGyp.py
|
|
|
c2f9c4d |
@@ -742,7 +742,7 @@ def FindVisualStudioInstallation():
|
|
|
c2f9c4d |
build_tool = None
|
|
|
c2f9c4d |
if not build_tool:
|
|
|
c2f9c4d |
args1 = ['reg', 'query',
|
|
|
c2f9c4d |
- 'HKLM\Software\Microsoft\VisualStudio\SxS\VS7',
|
|
|
c2f9c4d |
+ r'HKLM\Software\Microsoft\VisualStudio\SxS\VS7',
|
|
|
c2f9c4d |
'/v', '15.0', '/reg:32']
|
|
|
c2f9c4d |
build_tool = subprocess.check_output(args1).decode(
|
|
|
c2f9c4d |
'utf-8', 'ignore').strip().split(b'\r\n').pop().split(b' ').pop()
|