Changed not foo == None to foo is not None in image sniff handler
>>> class foo(object):
def __eq__(self, other):
return True
>>> f = foo()
>>> f == None
True
>>> f is None
False
-- <http://stackoverflow.com/questions/26595/is-there-any-difference-between-foo-is-none-and-foo-none>
This commit is contained in:
@@ -29,7 +29,7 @@ _log = logging.getLogger(__name__)
|
|||||||
SUPPORTED_FILETYPES = ['png', 'gif', 'jpg', 'jpeg']
|
SUPPORTED_FILETYPES = ['png', 'gif', 'jpg', 'jpeg']
|
||||||
|
|
||||||
def sniff_handler(media_file, **kw):
|
def sniff_handler(media_file, **kw):
|
||||||
if not kw.get('media') == None: # That's a double negative!
|
if kw.get('media') is not None: # That's a double negative!
|
||||||
name, ext = os.path.splitext(kw['media'].filename)
|
name, ext = os.path.splitext(kw['media'].filename)
|
||||||
clean_ext = ext[1:].lower() # Strip the . from ext and make lowercase
|
clean_ext = ext[1:].lower() # Strip the . from ext and make lowercase
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user