mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-20 16:03:59 +01:00
Fix E711 comparison to None should be if cond is None:
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
@@ -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()
|
||||
|
||||
|
||||
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user