Skip to content

Commit 3f4972c

Browse files
MrMebelManrvagg
authored andcommitted
gyp: use "is" when comparing to None
PR-URL: #1860 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
1 parent 1cb4708 commit 3f4972c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

gyp/pylib/gyp/generator/ninja.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ def cygwin_munge(path):
726726
elif var == 'name':
727727
extra_bindings.append(('name', cygwin_munge(basename)))
728728
else:
729-
assert var == None, repr(var)
729+
assert var is None, repr(var)
730730

731731
outputs = [self.GypPathToNinja(o, env) for o in outputs]
732732
if self.flavor == 'win':

gyp/pylib/gyp/generator/xcode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ def ExpandXcodeVariables(string, expansions):
539539
"""
540540

541541
matches = _xcode_variable_re.findall(string)
542-
if matches == None:
542+
if matches is None:
543543
return string
544544

545545
matches.reverse()

gyp/pylib/gyp/input.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def GetIncludedBuildFiles(build_file_path, aux_data, included=None):
155155
in the list will be relative to the current directory.
156156
"""
157157

158-
if included == None:
158+
if included is None:
159159
included = []
160160

161161
if build_file_path in included:
@@ -1062,7 +1062,7 @@ def EvalCondition(condition, conditions_key, phase, variables, build_file):
10621062
else:
10631063
false_dict = None
10641064
i = i + 2
1065-
if result == None:
1065+
if result is None:
10661066
result = EvalSingleCondition(
10671067
cond_expr, true_dict, false_dict, phase, variables, build_file)
10681068

@@ -1603,7 +1603,7 @@ def Visit(node, path):
16031603

16041604
def DirectDependencies(self, dependencies=None):
16051605
"""Returns a list of just direct dependencies."""
1606-
if dependencies == None:
1606+
if dependencies is None:
16071607
dependencies = []
16081608

16091609
for dependency in self.dependencies:
@@ -1631,7 +1631,7 @@ def _AddImportedDependencies(self, targets, dependencies=None):
16311631
public entry point.
16321632
"""
16331633

1634-
if dependencies == None:
1634+
if dependencies is None:
16351635
dependencies = []
16361636

16371637
index = 0

0 commit comments

Comments
 (0)