# HG changeset patch # User Marcin Kuzminski # Date 2013-05-22 01:15:44 # Node ID b84c83b651de3bd1de31cd247a0901b6e217428e # Parent 7aa0ff5b4e0925ae1a61e5142dd3f11fe262568d replace equality comparision to None diff --git a/rhodecode/bin/ldap_sync.py b/rhodecode/bin/ldap_sync.py --- a/rhodecode/bin/ldap_sync.py +++ b/rhodecode/bin/ldap_sync.py @@ -79,7 +79,7 @@ class RhodecodeAPI(): if uid != response["id"]: raise InvalidResponseIDError("UUID does not match.") - if response["error"] != None: + if response["error"] is not None: raise RhodecodeResponseError(response["error"]) return response["result"] diff --git a/rhodecode/controllers/changeset.py b/rhodecode/controllers/changeset.py --- a/rhodecode/controllers/changeset.py +++ b/rhodecode/controllers/changeset.py @@ -234,7 +234,7 @@ class ChangesetController(BaseRepoContro # show comments from them prs = set([x.pull_request for x in - filter(lambda x: x.pull_request != None, st)]) + filter(lambda x: x.pull_request is not None, st)]) for pr in prs: c.comments.extend(pr.comments) diff --git a/rhodecode/lib/db_manage.py b/rhodecode/lib/db_manage.py --- a/rhodecode/lib/db_manage.py +++ b/rhodecode/lib/db_manage.py @@ -514,7 +514,7 @@ class DbManage(object): ('ldap_attr_login', ''), ('ldap_attr_firstname', ''), ('ldap_attr_lastname', ''), ('ldap_attr_email', '')]: - if skip_existing and RhodeCodeSetting.get_by_name(k) != None: + if skip_existing and RhodeCodeSetting.get_by_name(k) is not None: log.debug('Skipping option %s' % k) continue setting = RhodeCodeSetting(k, v) @@ -530,7 +530,7 @@ class DbManage(object): ('default_repo_private', False), ('default_repo_type', 'hg')]: - if skip_existing and RhodeCodeSetting.get_by_name(k) != None: + if skip_existing and RhodeCodeSetting.get_by_name(k) is not None: log.debug('Skipping option %s' % k) continue setting = RhodeCodeSetting(k, v) diff --git a/rhodecode/lib/middleware/simplegit.py b/rhodecode/lib/middleware/simplegit.py --- a/rhodecode/lib/middleware/simplegit.py +++ b/rhodecode/lib/middleware/simplegit.py @@ -97,7 +97,7 @@ def is_git(environ): path_info = environ['PATH_INFO'] isgit_path = GIT_PROTO_PAT.match(path_info) log.debug('pathinfo: %s detected as GIT %s' % ( - path_info, isgit_path != None) + path_info, isgit_path is not None) ) return isgit_path diff --git a/rhodecode/lib/rcmail/response.py b/rhodecode/lib/rcmail/response.py --- a/rhodecode/lib/rcmail/response.py +++ b/rhodecode/lib/rcmail/response.py @@ -87,7 +87,7 @@ class MailBase(object): del self.headers[normalize_header(key)] def __nonzero__(self): - return self.body != None or len(self.headers) > 0 or len(self.parts) > 0 + return self.body is not None or len(self.headers) > 0 or len(self.parts) > 0 def keys(self): """Returns the sorted keys.""" @@ -388,7 +388,7 @@ class MIMEPart(MIMEBase): self.set_payload(encoded, charset=charset) def extract_payload(self, mail): - if mail.body == None: + if mail.body is None: return # only None, '' is still ok ctype, ctype_params = mail.content_encoding['Content-Type'] diff --git a/rhodecode/lib/vcs/subprocessio.py b/rhodecode/lib/vcs/subprocessio.py --- a/rhodecode/lib/vcs/subprocessio.py +++ b/rhodecode/lib/vcs/subprocessio.py @@ -368,7 +368,7 @@ class SubprocessIOChunker(object): # presence of stuff in stderr output) we error out. # Else, we are happy. _returncode = _p.poll() - if _returncode or (_returncode == None and bg_err.length): + if _returncode or (_returncode is None and bg_err.length): try: _p.terminate() except: diff --git a/rhodecode/tests/functional/test_admin_settings.py b/rhodecode/tests/functional/test_admin_settings.py --- a/rhodecode/tests/functional/test_admin_settings.py +++ b/rhodecode/tests/functional/test_admin_settings.py @@ -252,7 +252,7 @@ class TestAdminSettingsController(TestCo repo2 = Repository.get_by_repo_name(GIT_REPO) self.checkSessionFlash(response, 'Marked repo %s as fork of %s' % (repo.repo_name, "Nothing")) - assert repo.fork == None + assert repo.fork is None def test_set_fork_of_same_repo(self): self.log_user() diff --git a/rhodecode/tests/other/test_validators.py b/rhodecode/tests/other/test_validators.py --- a/rhodecode/tests/other/test_validators.py +++ b/rhodecode/tests/other/test_validators.py @@ -60,7 +60,7 @@ class TestReposGroups(BaseTestCase): gr2 = fixture.create_user_group('tes2') Session().commit() self.assertRaises(formencode.Invalid, validator.to_python, 'test') - assert gr.users_group_id != None + assert gr.users_group_id is not None validator = v.ValidUserGroup(edit=True, old_data={'users_group_id': gr2.users_group_id}) diff --git a/rhodecode/tests/scripts/test_concurency.py b/rhodecode/tests/scripts/test_concurency.py --- a/rhodecode/tests/scripts/test_concurency.py +++ b/rhodecode/tests/scripts/test_concurency.py @@ -161,7 +161,7 @@ def test_clone_with_credentials(no_error seq=None, backend='hg'): cwd = path = jn(TESTS_TMP_PATH, repo) - if seq == None: + if seq is None: seq = _RandomNameSequence().next() try: