##// END OF EJS Templates
code: code cleanups, use is None instead of == None.
marcink -
r3231:462664f1 default
parent child Browse files
Show More
@@ -175,8 +175,7 b' class AdminSettingsView(BaseAppView):'
175
175
176 try:
176 try:
177 if c.visual.allow_repo_location_change:
177 if c.visual.allow_repo_location_change:
178 model.update_global_path_setting(
178 model.update_global_path_setting(form_result['paths_root_path'])
179 form_result['paths_root_path'])
180
179
181 model.update_global_ssl_setting(form_result['web_push_ssl'])
180 model.update_global_ssl_setting(form_result['web_push_ssl'])
182 model.update_global_hook_settings(form_result)
181 model.update_global_hook_settings(form_result)
@@ -95,7 +95,7 b' class diff_match_patch:'
95 Array of changes.
95 Array of changes.
96 """
96 """
97 # Set a deadline by which time the diff must be complete.
97 # Set a deadline by which time the diff must be complete.
98 if deadline == None:
98 if deadline is None:
99 # Unlike in most languages, Python counts time in seconds.
99 # Unlike in most languages, Python counts time in seconds.
100 if self.Diff_Timeout <= 0:
100 if self.Diff_Timeout <= 0:
101 deadline = sys.maxint
101 deadline = sys.maxint
@@ -103,7 +103,7 b' class diff_match_patch:'
103 deadline = time.time() + self.Diff_Timeout
103 deadline = time.time() + self.Diff_Timeout
104
104
105 # Check for null inputs.
105 # Check for null inputs.
106 if text1 == None or text2 == None:
106 if text1 is None or text2 is None:
107 raise ValueError("Null inputs. (diff_main)")
107 raise ValueError("Null inputs. (diff_main)")
108
108
109 # Check for equality (speedup).
109 # Check for equality (speedup).
@@ -1227,7 +1227,7 b' class diff_match_patch:'
1227 Best match index or -1.
1227 Best match index or -1.
1228 """
1228 """
1229 # Check for null inputs.
1229 # Check for null inputs.
1230 if text == None or pattern == None:
1230 if text is None or pattern is None:
1231 raise ValueError("Null inputs. (match_main)")
1231 raise ValueError("Null inputs. (match_main)")
1232
1232
1233 loc = max(0, min(loc, len(text)))
1233 loc = max(0, min(loc, len(text)))
@@ -1576,10 +1576,8 b' class PullRequestModel(BaseModel):'
1576 from rc_reviewers.utils import get_default_reviewers_data
1576 from rc_reviewers.utils import get_default_reviewers_data
1577 from rc_reviewers.utils import validate_default_reviewers
1577 from rc_reviewers.utils import validate_default_reviewers
1578 except ImportError:
1578 except ImportError:
1579 from rhodecode.apps.repository.utils import \
1579 from rhodecode.apps.repository.utils import get_default_reviewers_data
1580 get_default_reviewers_data
1580 from rhodecode.apps.repository.utils import validate_default_reviewers
1581 from rhodecode.apps.repository.utils import \
1582 validate_default_reviewers
1583
1581
1584 return get_default_reviewers_data, validate_default_reviewers
1582 return get_default_reviewers_data, validate_default_reviewers
1585
1583
@@ -582,7 +582,6 b' class VcsSettingsModel(object):'
582 self._create_or_update_ui(
582 self._create_or_update_ui(
583 self.repo_settings, *phases, value=safe_str(data[phases_key]))
583 self.repo_settings, *phases, value=safe_str(data[phases_key]))
584
584
585
586 def create_or_update_global_hg_settings(self, data):
585 def create_or_update_global_hg_settings(self, data):
587 largefiles, largefiles_store, phases, hgsubversion, evolve \
586 largefiles, largefiles_store, phases, hgsubversion, evolve \
588 = self.GLOBAL_HG_SETTINGS
587 = self.GLOBAL_HG_SETTINGS
@@ -259,13 +259,13 b' class TestRepositoryGetCommonAncestor:'
259 commit_id1=original[0].raw_id,
259 commit_id1=original[0].raw_id,
260 commit_id2=unrelated[0].raw_id,
260 commit_id2=unrelated[0].raw_id,
261 repo2=unrelated
261 repo2=unrelated
262 ) == None
262 ) is None
263
263
264 assert original.get_common_ancestor(
264 assert original.get_common_ancestor(
265 commit_id1=original[-1].raw_id,
265 commit_id1=original[-1].raw_id,
266 commit_id2=unrelated[-1].raw_id,
266 commit_id2=unrelated[-1].raw_id,
267 repo2=unrelated
267 repo2=unrelated
268 ) == None
268 ) is None
269
269
270
270
271 @pytest.mark.backends("git", "hg")
271 @pytest.mark.backends("git", "hg")
General Comments 0
You need to be logged in to leave comments. Login now