mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-10 00:20:57 +03:00
Remove unnecessary bool() calls throughout project
Can use truthy values in boolean expressions without first coercing to a bool. Removes unnecessary call to bool().
This commit is contained in:
parent
92bb1b5f06
commit
c5a0d72c10
|
@ -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