Use `==` to compare against the empty string, not `is`

py38 will start complaining like

   SyntaxWarning: "is" with a literal. Did you mean "=="?

Change-Id: I799e288f66230a7847a13b7f303e4cd8e63eea59
This commit is contained in:
Tim Burke 2019-10-14 17:40:42 -07:00
parent 405a2b2a55
commit 3bd5653873
4 changed files with 4 additions and 4 deletions

View File

@ -267,7 +267,7 @@ def run_daemon(klass, conf_file, section_name='', once=False, **kwargs):
"""
# very often the config section_name is based on the class name
# the None singleton will be passed through to readconf as is
if section_name is '':
if section_name == '':
section_name = sub(r'([a-z])([A-Z])', r'\1-\2',
klass.__name__).lower()
try:

View File

@ -217,7 +217,7 @@ def parse_acl_v2(data):
"""
if data is None:
return None
if data is '':
if data == '':
return {}
try:
result = json.loads(data)

View File

@ -187,7 +187,7 @@ class TestRequest(S3ApiTestCase):
self.assertEqual(mock_get_resp.call_count, 2)
args, kargs = mock_get_resp.call_args_list[0]
get_resp_obj = args[3]
self.assertTrue(get_resp_obj is '')
self.assertEqual(get_resp_obj, '')
self.assertEqual(m_check_permission.call_count, 1)
args, kargs = m_check_permission.call_args
permission = args[1]

View File

@ -600,7 +600,7 @@ class TestWSGI(unittest.TestCase):
logger = logging.getLogger('test')
sock = listen_zero()
wsgi.run_server(conf, logger, sock)
self.assertTrue(os.environ['TZ'] is not '')
self.assertNotEqual(os.environ['TZ'], '')
self.assertEqual(30, _wsgi.WRITE_TIMEOUT)
_wsgi_evt.hubs.use_hub.assert_called_with(utils.get_hub())