Fix various 'testing inequality to None' syntax issues

Substitute `is not None` for `!= None`
This commit is contained in:
luz paz
2022-07-30 17:26:11 -04:00
committed by Chris Hennes
parent 119a402c66
commit c457f3bfbd
7 changed files with 23 additions and 23 deletions

View File

@@ -212,7 +212,7 @@ def build_deps_graph(graph, bundle_path, dirs_filter=None, search_paths=[]):
visited = {}
for root, dirs, files in os.walk(bundle_path):
if dirs_filter != None:
if dirs_filter is not None:
dirs[:] = [d for d in dirs if should_visit(bundle_path, dirs_filter,
os.path.join(root, d))]

View File

@@ -14,10 +14,10 @@ d=dict()
l=list()
for line in lines:
r=re.search("\\(#\\s*\\d+\\)",line)
if r != None:
if r is not None:
s=line[r.start():r.end()]
t=re.search("^Leak",line)
if t != None:
if t is not None:
m=d[s]
l.append(m)
else:

View File

@@ -97,7 +97,7 @@ class DebianChangelog(VersionControl):
c = f.readline()
f.close()
r=re.search("bzr(\\d+)",c)
if r != None:
if r is not None:
self.rev = r.groups()[0] + " (Launchpad)"
t = time.localtime()
@@ -116,11 +116,11 @@ class BazaarControl(VersionControl):
lines=info.split("\n")
for i in lines:
r = re.match("^revno: (\\d+)$", i)
if r != None:
if r is not None:
self.rev = r.groups()[0]
continue
r=re.match("^timestamp: (\\w+ \\d+-\\d+-\\d+ \\d+:\\d+:\\d+)",i)
if r != None:
if r is not None:
self.date = r.groups()[0]
continue
return True
@@ -325,7 +325,7 @@ class GitControl(VersionControl):
self.date = time.strftime("%Y/%m/%d %H:%M:%S",time.gmtime(\
float(info.strip().split(' ',1)[0])))
for self.branch in os.popen("git branch --no-color").read().split('\n'):
if re.match( "\*", self.branch ) != None:
if re.match( "\*", self.branch ) is not None:
break
self.branch=self.branch[2:]
self.getremotes() #setup self.remotes and branchlst
@@ -356,7 +356,7 @@ class GitControl(VersionControl):
if self.url == "Unknown":
for i in info:
r = re.match("origin\\W+(\\S+)",i)
if r != None:
if r is not None:
self.url = r.groups()[0]
break
return True
@@ -421,12 +421,12 @@ class Subversion(VersionControl):
# if version string ends with an 'M'
r=re.search("M$",Ver)
if r != None:
if r is not None:
self.mods = 'Src modified'
# if version string contains a range
r=re.match("^\\d+\\:\\d+",Ver)
if r != None:
if r is not None:
self.mixed = 'Src mixed'
self.range = Ver[:r.end()]
return True

View File

@@ -225,7 +225,7 @@ public:
-
//@}
+ if(self.export.CustomAttributes != None):
+ if(self.export.CustomAttributes is not None):
/// getter method for special attributes (e.g. dynamic ones)
PyObject *getCustomAttributes(const char* attr) const;
/// setter for special attributes (e.g. dynamic ones)
@@ -720,7 +720,7 @@ PyObject *@self.export.Name@::_repr()
return Py_BuildValue("s", representation().c_str());
}
+ if(self.export.CustomAttributes != None):
+ if(self.export.CustomAttributes is not None):
//--------------------------------------------------------------------------
// @self.export.Name@ Attributes
//--------------------------------------------------------------------------
@@ -1119,7 +1119,7 @@ void @self.export.Name@::set@i.Name@(Py::@i.Parameter.Type@ arg)
}
-
-
+ if(self.export.CustomAttributes != None):
+ if(self.export.CustomAttributes is not None):
PyObject *@self.export.Name@::getCustomAttributes(const char* /*attr*/) const
{
@@ -1446,7 +1446,7 @@ void @self.export.Name@::set@i.Name@(Py::@i.Parameter.Type@ /*arg*/)
}
-
-
+ if(self.export.CustomAttributes != None):
+ if(self.export.CustomAttributes is not None):
PyObject *@self.export.Name@::getCustomAttributes(const char* /*attr*/) const
{