Fix E711 comparison to None should be if cond is None:

This commit is contained in:
Jesse Mullan
2014-11-01 16:22:05 -07:00
parent 5ede29b401
commit 015d269667
12 changed files with 18 additions and 18 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ class BaseJobStore(six.with_metaclass(ABCMeta)):
def get_all_jobs(self):
"""
Returns a list of all jobs in this job store. The returned jobs should be sorted by next run time (ascending).
Paused jobs (next_run_time == None) should be sorted last.
Paused jobs (next_run_time is None) should be sorted last.
The job store is responsible for setting the ``scheduler`` and ``jobstore`` attributes of the returned jobs to
point to the scheduler and itself, respectively.
+2 -2
View File
@@ -206,8 +206,8 @@ def string_dist(str1, str2):
an edit distance, normalized by the string length, with a number of
tweaks that reflect intuition about text.
"""
if str1 == None and str2 == None: return 0.0
if str1 == None or str2 == None: return 1.0
if str1 is None and str2 is None: return 0.0
if str1 is None or str2 is None: return 1.0
str1 = str1.lower()
str2 = str2.lower()
+1 -1
View File
@@ -268,7 +268,7 @@ class Element(html5lib.treebuilders._base.Node):
return self.element.contents
def getNameTuple(self):
if self.namespace == None:
if self.namespace is None:
return namespaces["html"], self.name
else:
return self.namespace, self.name
+1 -1
View File
@@ -1736,7 +1736,7 @@ if _XML_AVAILABLE:
else:
givenprefix = None
prefix = self._matchnamespaces.get(lowernamespace, givenprefix)
if givenprefix and (prefix == None or (prefix == '' and lowernamespace == '')) and not self.namespacesInUse.has_key(givenprefix):
if givenprefix and (prefix is None or (prefix == '' and lowernamespace == '')) and not self.namespacesInUse.has_key(givenprefix):
raise UndeclaredNamespace, "'%s' is not associated with a namespace" % givenprefix
localname = str(localname).lower()
+1 -1
View File
@@ -939,7 +939,7 @@ the same interface as FileCache."""
if response.has_key('location'):
location = response['location']
(scheme, authority, path, query, fragment) = parse_uri(location)
if authority == None:
if authority is None:
response['location'] = urlparse.urljoin(absolute_uri, location)
if response.status == 301 and method in ["GET", "HEAD"]:
response['-x-permanent-redirect-url'] = response['location']