##// END OF EJS Templates
replace equality comparision to None
marcink -
r3889:b84c83b6 beta
parent child Browse files
Show More
@@ -79,7 +79,7 b' class RhodecodeAPI():'
79 if uid != response["id"]:
79 if uid != response["id"]:
80 raise InvalidResponseIDError("UUID does not match.")
80 raise InvalidResponseIDError("UUID does not match.")
81
81
82 if response["error"] != None:
82 if response["error"] is not None:
83 raise RhodecodeResponseError(response["error"])
83 raise RhodecodeResponseError(response["error"])
84
84
85 return response["result"]
85 return response["result"]
@@ -234,7 +234,7 b' class ChangesetController(BaseRepoContro'
234 # show comments from them
234 # show comments from them
235
235
236 prs = set([x.pull_request for x in
236 prs = set([x.pull_request for x in
237 filter(lambda x: x.pull_request != None, st)])
237 filter(lambda x: x.pull_request is not None, st)])
238
238
239 for pr in prs:
239 for pr in prs:
240 c.comments.extend(pr.comments)
240 c.comments.extend(pr.comments)
@@ -514,7 +514,7 b' class DbManage(object):'
514 ('ldap_attr_login', ''), ('ldap_attr_firstname', ''),
514 ('ldap_attr_login', ''), ('ldap_attr_firstname', ''),
515 ('ldap_attr_lastname', ''), ('ldap_attr_email', '')]:
515 ('ldap_attr_lastname', ''), ('ldap_attr_email', '')]:
516
516
517 if skip_existing and RhodeCodeSetting.get_by_name(k) != None:
517 if skip_existing and RhodeCodeSetting.get_by_name(k) is not None:
518 log.debug('Skipping option %s' % k)
518 log.debug('Skipping option %s' % k)
519 continue
519 continue
520 setting = RhodeCodeSetting(k, v)
520 setting = RhodeCodeSetting(k, v)
@@ -530,7 +530,7 b' class DbManage(object):'
530 ('default_repo_private', False),
530 ('default_repo_private', False),
531 ('default_repo_type', 'hg')]:
531 ('default_repo_type', 'hg')]:
532
532
533 if skip_existing and RhodeCodeSetting.get_by_name(k) != None:
533 if skip_existing and RhodeCodeSetting.get_by_name(k) is not None:
534 log.debug('Skipping option %s' % k)
534 log.debug('Skipping option %s' % k)
535 continue
535 continue
536 setting = RhodeCodeSetting(k, v)
536 setting = RhodeCodeSetting(k, v)
@@ -97,7 +97,7 b' def is_git(environ):'
97 path_info = environ['PATH_INFO']
97 path_info = environ['PATH_INFO']
98 isgit_path = GIT_PROTO_PAT.match(path_info)
98 isgit_path = GIT_PROTO_PAT.match(path_info)
99 log.debug('pathinfo: %s detected as GIT %s' % (
99 log.debug('pathinfo: %s detected as GIT %s' % (
100 path_info, isgit_path != None)
100 path_info, isgit_path is not None)
101 )
101 )
102 return isgit_path
102 return isgit_path
103
103
@@ -87,7 +87,7 b' class MailBase(object):'
87 del self.headers[normalize_header(key)]
87 del self.headers[normalize_header(key)]
88
88
89 def __nonzero__(self):
89 def __nonzero__(self):
90 return self.body != None or len(self.headers) > 0 or len(self.parts) > 0
90 return self.body is not None or len(self.headers) > 0 or len(self.parts) > 0
91
91
92 def keys(self):
92 def keys(self):
93 """Returns the sorted keys."""
93 """Returns the sorted keys."""
@@ -388,7 +388,7 b' class MIMEPart(MIMEBase):'
388 self.set_payload(encoded, charset=charset)
388 self.set_payload(encoded, charset=charset)
389
389
390 def extract_payload(self, mail):
390 def extract_payload(self, mail):
391 if mail.body == None:
391 if mail.body is None:
392 return # only None, '' is still ok
392 return # only None, '' is still ok
393
393
394 ctype, ctype_params = mail.content_encoding['Content-Type']
394 ctype, ctype_params = mail.content_encoding['Content-Type']
@@ -368,7 +368,7 b' class SubprocessIOChunker(object):'
368 # presence of stuff in stderr output) we error out.
368 # presence of stuff in stderr output) we error out.
369 # Else, we are happy.
369 # Else, we are happy.
370 _returncode = _p.poll()
370 _returncode = _p.poll()
371 if _returncode or (_returncode == None and bg_err.length):
371 if _returncode or (_returncode is None and bg_err.length):
372 try:
372 try:
373 _p.terminate()
373 _p.terminate()
374 except:
374 except:
@@ -252,7 +252,7 b' class TestAdminSettingsController(TestCo'
252 repo2 = Repository.get_by_repo_name(GIT_REPO)
252 repo2 = Repository.get_by_repo_name(GIT_REPO)
253 self.checkSessionFlash(response,
253 self.checkSessionFlash(response,
254 'Marked repo %s as fork of %s' % (repo.repo_name, "Nothing"))
254 'Marked repo %s as fork of %s' % (repo.repo_name, "Nothing"))
255 assert repo.fork == None
255 assert repo.fork is None
256
256
257 def test_set_fork_of_same_repo(self):
257 def test_set_fork_of_same_repo(self):
258 self.log_user()
258 self.log_user()
@@ -60,7 +60,7 b' class TestReposGroups(BaseTestCase):'
60 gr2 = fixture.create_user_group('tes2')
60 gr2 = fixture.create_user_group('tes2')
61 Session().commit()
61 Session().commit()
62 self.assertRaises(formencode.Invalid, validator.to_python, 'test')
62 self.assertRaises(formencode.Invalid, validator.to_python, 'test')
63 assert gr.users_group_id != None
63 assert gr.users_group_id is not None
64 validator = v.ValidUserGroup(edit=True,
64 validator = v.ValidUserGroup(edit=True,
65 old_data={'users_group_id':
65 old_data={'users_group_id':
66 gr2.users_group_id})
66 gr2.users_group_id})
@@ -161,7 +161,7 b' def test_clone_with_credentials(no_error'
161 seq=None, backend='hg'):
161 seq=None, backend='hg'):
162 cwd = path = jn(TESTS_TMP_PATH, repo)
162 cwd = path = jn(TESTS_TMP_PATH, repo)
163
163
164 if seq == None:
164 if seq is None:
165 seq = _RandomNameSequence().next()
165 seq = _RandomNameSequence().next()
166
166
167 try:
167 try:
General Comments 0
You need to be logged in to leave comments. Login now