Merge pull request #2891 from jdufresne/bool-expr

Remove unnecessary bool() calls throughout project
This commit is contained in:
wiredfool 2017-12-18 13:36:13 +00:00 committed by GitHub
commit 384da7dbd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -2753,7 +2753,7 @@ def registered_extensions():
Returns a dictionary containing all file extensions belonging Returns a dictionary containing all file extensions belonging
to registered plugins to registered plugins
""" """
if not bool(EXTENSION): if not EXTENSION:
init() init()
return EXTENSION return EXTENSION

View File

@ -165,7 +165,7 @@ class PillowTestCase(unittest.TestCase):
travis=None, interpreter=None): travis=None, interpreter=None):
# Skip if platform/travis matches, and # Skip if platform/travis matches, and
# PILLOW_RUN_KNOWN_BAD is not true in the environment. # PILLOW_RUN_KNOWN_BAD is not true in the environment.
if bool(os.environ.get('PILLOW_RUN_KNOWN_BAD', False)): if os.environ.get('PILLOW_RUN_KNOWN_BAD', False):
print(os.environ.get('PILLOW_RUN_KNOWN_BAD', False)) print(os.environ.get('PILLOW_RUN_KNOWN_BAD', False))
return return

View File

@ -312,7 +312,7 @@ class TestImage(PillowTestCase):
extensions = Image.registered_extensions() extensions = Image.registered_extensions()
# Assert # Assert
self.assertTrue(bool(extensions)) self.assertTrue(extensions)
for ext in ['.cur', '.icns', '.tif', '.tiff']: for ext in ['.cur', '.icns', '.tif', '.tiff']:
self.assertIn(ext, extensions) self.assertIn(ext, extensions)