From f96a5a1cf8800edc2f6a6d73316f7d7c67f32e29 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 30 Jan 2011 16:20:37 +0100 Subject: cleanup code --- module/lib/BeautifulSoup.py | 2 +- module/lib/feedparser.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'module/lib') diff --git a/module/lib/BeautifulSoup.py b/module/lib/BeautifulSoup.py index 748e6fe4b..55567f588 100644 --- a/module/lib/BeautifulSoup.py +++ b/module/lib/BeautifulSoup.py @@ -1295,7 +1295,7 @@ class BeautifulStoneSoup(Tag, SGMLParser): """ nestingResetTriggers = self.NESTABLE_TAGS.get(name) - isNestable = nestingResetTriggers != None + isNestable = nestingResetTriggers is not None isResetNesting = self.RESET_NESTING_TAGS.has_key(name) popTo = None inclusive = True diff --git a/module/lib/feedparser.py b/module/lib/feedparser.py index 1fd5cfc3e..a746ed8f5 100644 --- a/module/lib/feedparser.py +++ b/module/lib/feedparser.py @@ -1685,7 +1685,7 @@ class _FeedParserMixin: def _end_media_thumbnail(self): url = self.pop('url') context = self._getContext() - if url != None and len(url.strip()) != 0: + if url is not None and len(url.strip()) != 0: if not context['media_thumbnail'][-1].has_key('url'): context['media_thumbnail'][-1]['url'] = url @@ -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() @@ -2806,7 +2806,7 @@ class _FeedURLHandler(urllib2.HTTPDigestAuthHandler, urllib2.HTTPRedirectHandler host = urlparse.urlparse(req.get_full_url())[1] try: assert sys.version.split()[0] >= '2.3.3' - assert base64 != None + assert base64 is not None user, passw = _base64decode(req.headers['Authorization'].split(' ')[1]).split(':') realm = re.findall('realm="([^"]*)"', headers['WWW-Authenticate'])[0] self.add_password(realm, host, user, passw) -- cgit v1.2.3