Merge pull request #23317 from lupoDharkael/py-none

Dont use equality operators with None singleton in python files
This commit is contained in:
Rémi Verschelde 2018-10-29 12:11:24 +01:00 committed by GitHub
commit 8650793eac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 15 additions and 15 deletions

View File

@ -544,7 +544,7 @@ if 'env' in locals():
[os.remove(f) for f in files]
def file_list(self):
if self.path == None:
if self.path is None:
# Nothing to do
return []
# Gather a list of (filename, (size, atime)) within the
@ -569,7 +569,7 @@ if 'env' in locals():
if sum > self.limit:
mark = i
break
if mark == None:
if mark is None:
return []
else:
return [x[0] for x in file_stat[mark:]]

View File

@ -82,7 +82,7 @@ def find_signal_descr(old_class, name):
def find_constant_descr(old_class, name):
if (old_class == None):
if (old_class is None):
return None
constants = old_class.find("constants")
if(constants != None and len(list(constants)) > 0):

View File

@ -375,7 +375,7 @@ def make_method(
event=False,
pp=None
):
if (declare or pp == None):
if (declare or pp is None):
t = '- '
else:
t = ""
@ -405,7 +405,7 @@ def make_method(
t += 'void'
t += ' '
if declare or pp == None:
if declare or pp is None:
s = '**' + method_data.attrib['name'] + '** '
else:
@ -577,7 +577,7 @@ def make_rst_class(node):
make_method(f, name, m, True, True)
f.write('\n')
d = m.find('description')
if d == None or d.text.strip() == '':
if d is None or d.text.strip() == '':
continue
f.write(rstize_text(d.text.strip(), name))
f.write("\n\n")
@ -676,7 +676,7 @@ def make_rst_class(node):
make_method(f, name, m, True)
f.write('\n')
d = m.find('description')
if d == None or d.text.strip() == '':
if d is None or d.text.strip() == '':
continue
f.write(rstize_text(d.text.strip(), name))
f.write("\n\n")

View File

@ -59,11 +59,11 @@ def include_file_in_legacygl_header(filename, header_data, depth):
included_file = os.path.relpath(os.path.dirname(filename) + "/" + includeline)
if not included_file in header_data.vertex_included_files and header_data.reading == "vertex":
header_data.vertex_included_files += [included_file]
if include_file_in_legacygl_header(included_file, header_data, depth + 1) == None:
if include_file_in_legacygl_header(included_file, header_data, depth + 1) is None:
print("Error in file '" + filename + "': #include " + includeline + "could not be found!")
elif not included_file in header_data.fragment_included_files and header_data.reading == "fragment":
header_data.fragment_included_files += [included_file]
if include_file_in_legacygl_header(included_file, header_data, depth + 1) == None:
if include_file_in_legacygl_header(included_file, header_data, depth + 1) is None:
print("Error in file '" + filename + "': #include " + includeline + "could not be found!")
line = fs.readline()

View File

@ -330,7 +330,7 @@ def split_lib(self, libname, src_list = None, env_lib = None):
list = []
lib_list = []
if src_list == None:
if src_list is None:
src_list = getattr(env, libname + "_sources")
if type(env_lib) == type(None):

View File

@ -186,7 +186,7 @@ def configure(env):
env.PrependENVPath('PATH', tools_path)
ccache_path = os.environ.get("CCACHE")
if ccache_path == None:
if ccache_path is None:
env['CC'] = compiler_path + '/clang'
env['CXX'] = compiler_path + '/clang++'
else:
@ -293,7 +293,7 @@ def configure(env):
# Return NDK version string in source.properties (adapted from the Chromium project).
def get_ndk_version(path):
if path == None:
if path is None:
return None
prop_file_path = os.path.join(path, "source.properties")
try:

View File

@ -87,7 +87,7 @@ def configure(env):
s_compiler_path = '$IPHONEPATH/Developer/usr/bin/'
ccache_path = os.environ.get("CCACHE")
if ccache_path == None:
if ccache_path is None:
env['CC'] = compiler_path + 'clang'
env['CXX'] = compiler_path + 'clang++'
env['S_compiler'] = s_compiler_path + 'gcc'

View File

@ -89,7 +89,7 @@ def configure(env):
basecmd = root + "/target/bin/x86_64-apple-" + env["osxcross_sdk"] + "-"
ccache_path = os.environ.get("CCACHE")
if ccache_path == None:
if ccache_path is None:
env['CC'] = basecmd + "cc"
env['CXX'] = basecmd + "c++"
else:

View File

@ -17,7 +17,7 @@ def can_build():
# building natively on windows!
if (os.getenv("VSINSTALLDIR")):
if (os.getenv("ANGLE_SRC_PATH") == None):
if (os.getenv("ANGLE_SRC_PATH") is None):
return False
return True