1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Tom Hughes <tom@compton.nu>
3 Date: Fri, 23 Aug 2019 09:33:14 +0100
4 Subject: [PATCH] gyp-python38
6 Fix python 3.8 warnings
10 pylib/gyp/input.py | 2 +-
11 test/lib/TestCmd.py | 6 +++---
12 test/lib/TestGyp.py | 2 +-
13 3 files changed, 5 insertions(+), 5 deletions(-)
15 diff --git a/pylib/gyp/input.py b/pylib/gyp/input.py
16 index 4c1289164045..2bea3341adc5 100644
17 --- a/pylib/gyp/input.py
18 +++ b/pylib/gyp/input.py
19 @@ -1183,7 +1183,7 @@ def LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key):
20 if variable_name in variables:
21 # If the variable is already set, don't set it.
23 - if the_dict_key is 'variables' and variable_name in the_dict:
24 + if the_dict_key == 'variables' and variable_name in the_dict:
25 # If the variable is set without a % in the_dict, and the_dict is a
26 # variables dict (making |variables| a varaibles sub-dict of a
27 # variables dict), use the_dict's definition.
28 diff --git a/test/lib/TestCmd.py b/test/lib/TestCmd.py
29 index 1ec50933a4a8..457694c877d4 100644
30 --- a/test/lib/TestCmd.py
31 +++ b/test/lib/TestCmd.py
32 @@ -283,7 +283,7 @@ if os.name in ('posix', 'nt'):
34 tempfile.template = 'testcmd.'
36 -re_space = re.compile('\s')
37 +re_space = re.compile(r'\s')
41 @@ -882,7 +882,7 @@ class TestCmd(object):
42 #self.diff_function = difflib.unified_diff
44 self._preserve = {'pass_test': 0, 'fail_test': 0, 'no_result': 0}
45 - if 'PRESERVE' in os.environ and os.environ['PRESERVE'] is not '':
46 + if 'PRESERVE' in os.environ and os.environ['PRESERVE'] != '':
47 self._preserve['pass_test'] = os.environ['PRESERVE']
48 self._preserve['fail_test'] = os.environ['PRESERVE']
49 self._preserve['no_result'] = os.environ['PRESERVE']
50 @@ -1103,7 +1103,7 @@ class TestCmd(object):
51 the temporary working directories to be preserved for all
54 - if conditions is ():
55 + if len(conditions) == 0:
56 conditions = ('pass_test', 'fail_test', 'no_result')
57 for cond in conditions:
58 self._preserve[cond] = 1
59 diff --git a/test/lib/TestGyp.py b/test/lib/TestGyp.py
60 index 2aa78684f517..badfa910100f 100644
61 --- a/test/lib/TestGyp.py
62 +++ b/test/lib/TestGyp.py
63 @@ -743,7 +743,7 @@ def FindVisualStudioInstallation():
66 args1 = ['reg', 'query',
67 - 'HKLM\Software\Microsoft\VisualStudio\SxS\VS7',
68 + r'HKLM\Software\Microsoft\VisualStudio\SxS\VS7',
69 '/v', '15.0', '/reg:32']
70 build_tool = subprocess.check_output(args1).decode(
71 'utf-8', 'ignore').strip().split(b'\r\n').pop().split(b' ').pop()