Skip to content
Snippets Groups Projects
Unverified Commit 8a612c4d authored by Ned Batchelder's avatar Ned Batchelder Committed by GitHub
Browse files

Merge pull request #20027 from cclauss/Fix-F632

Use ==/!= to compare str, bytes, and int literals
parents e911898e bb31716c
No related branches found
No related tags found
No related merge requests found
......@@ -294,7 +294,7 @@ class PaginationTestCase(AssetsTestCase):
assets_response = json_response['assets']
self.assertEquals(filter_value_split, json_response['assetTypes'])
if filter_value is not '':
if filter_value != '':
content_types = [asset['content_type'].lower()
for asset in assets_response]
if 'OTHER' in filter_value_split:
......
......@@ -7,7 +7,7 @@ from django.db import migrations, models
def add_default_enable(apps, schema_editor):
ForumsConfig = apps.get_model("django_comment_common", "ForumsConfig")
settings_count = ForumsConfig.objects.count()
if settings_count is 0:
if settings_count == 0:
# By default we want the comment client enabled, but this is *not* enabling
# discussions themselves by default, as in showing the Disucussions tab, or
# inline discussions, etc. It just allows the underlying service client to work.
......
......@@ -634,12 +634,12 @@ def click_tools():
@world.absorb
def is_mac():
return platform.mac_ver()[0] is not ''
return platform.mac_ver()[0] != ''
@world.absorb
def is_firefox():
return world.browser.driver_name is 'Firefox'
return world.browser.driver_name == 'Firefox'
@world.absorb
......
......@@ -48,7 +48,7 @@ class Date(JSONField):
"""
if field is None:
return field
elif field is "":
elif field == "":
return None
elif isinstance(field, basestring):
return self._parse_date_wo_default_month_day(field)
......
......@@ -156,7 +156,7 @@ class CourseGradeFactory(object):
course_data,
persistent_grade.percent_grade,
persistent_grade.letter_grade,
persistent_grade.letter_grade is not u''
persistent_grade.letter_grade != u''
)
@staticmethod
......
......@@ -198,7 +198,7 @@ class FormatInterpolateVisitor(BaseVisitor):
node: The AST root node.
"""
if isinstance(node.func, ast.Attribute) and node.func.attr is 'format':
if isinstance(node.func, ast.Attribute) and node.func.attr == 'format':
if self.format_caller_node is None:
# Store the caller, or left-hand-side node of the initial
# format() call.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment