Dont use equality operators with None singleton in python files

This commit is contained in:
lupoDharkael 2018-10-27 01:18:15 +02:00
parent 970b58148f
commit edcca5f7ad
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] [os.remove(f) for f in files]
def file_list(self): def file_list(self):
if self.path == None: if self.path is None:
# Nothing to do # Nothing to do
return [] return []
# Gather a list of (filename, (size, atime)) within the # Gather a list of (filename, (size, atime)) within the
@ -569,7 +569,7 @@ if 'env' in locals():
if sum > self.limit: if sum > self.limit:
mark = i mark = i
break break
if mark == None: if mark is None:
return [] return []
else: else:
return [x[0] for x in file_stat[mark:]] 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): def find_constant_descr(old_class, name):
if (old_class == None): if (old_class is None):
return None return None
constants = old_class.find("constants") constants = old_class.find("constants")
if(constants != None and len(list(constants)) > 0): if(constants != None and len(list(constants)) > 0):

View File

@ -375,7 +375,7 @@ def make_method(
event=False, event=False,
pp=None pp=None
): ):
if (declare or pp == None): if (declare or pp is None):
t = '- ' t = '- '
else: else:
t = "" t = ""
@ -405,7 +405,7 @@ def make_method(
t += 'void' t += 'void'
t += ' ' t += ' '
if declare or pp == None: if declare or pp is None:
s = '**' + method_data.attrib['name'] + '** ' s = '**' + method_data.attrib['name'] + '** '
else: else:
@ -577,7 +577,7 @@ def make_rst_class(node):
make_method(f, name, m, True, True) make_method(f, name, m, True, True)
f.write('\n') f.write('\n')
d = m.find('description') d = m.find('description')
if d == None or d.text.strip() == '': if d is None or d.text.strip() == '':
continue continue
f.write(rstize_text(d.text.strip(), name)) f.write(rstize_text(d.text.strip(), name))
f.write("\n\n") f.write("\n\n")
@ -676,7 +676,7 @@ def make_rst_class(node):
make_method(f, name, m, True) make_method(f, name, m, True)
f.write('\n') f.write('\n')
d = m.find('description') d = m.find('description')
if d == None or d.text.strip() == '': if d is None or d.text.strip() == '':
continue continue
f.write(rstize_text(d.text.strip(), name)) f.write(rstize_text(d.text.strip(), name))
f.write("\n\n") 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) 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": if not included_file in header_data.vertex_included_files and header_data.reading == "vertex":
header_data.vertex_included_files += [included_file] 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!") 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": elif not included_file in header_data.fragment_included_files and header_data.reading == "fragment":
header_data.fragment_included_files += [included_file] 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!") print("Error in file '" + filename + "': #include " + includeline + "could not be found!")
line = fs.readline() line = fs.readline()

View File

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

View File

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

View File

@ -87,7 +87,7 @@ def configure(env):
s_compiler_path = '$IPHONEPATH/Developer/usr/bin/' s_compiler_path = '$IPHONEPATH/Developer/usr/bin/'
ccache_path = os.environ.get("CCACHE") ccache_path = os.environ.get("CCACHE")
if ccache_path == None: if ccache_path is None:
env['CC'] = compiler_path + 'clang' env['CC'] = compiler_path + 'clang'
env['CXX'] = compiler_path + 'clang++' env['CXX'] = compiler_path + 'clang++'
env['S_compiler'] = s_compiler_path + 'gcc' 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"] + "-" basecmd = root + "/target/bin/x86_64-apple-" + env["osxcross_sdk"] + "-"
ccache_path = os.environ.get("CCACHE") ccache_path = os.environ.get("CCACHE")
if ccache_path == None: if ccache_path is None:
env['CC'] = basecmd + "cc" env['CC'] = basecmd + "cc"
env['CXX'] = basecmd + "c++" env['CXX'] = basecmd + "c++"
else: else:

View File

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