mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-02 10:53:10 +03:00
Merge pull request #2891 from jdufresne/bool-expr
Remove unnecessary bool() calls throughout project
This commit is contained in:
commit
384da7dbd8
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user