From e2caf5743c29655ebc14e9601042c378c2c00325 Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Thu, 8 Mar 2012 22:58:16 +0100 Subject: [PATCH] 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 -- --- mediagoblin/media_types/image/processing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediagoblin/media_types/image/processing.py b/mediagoblin/media_types/image/processing.py index 28cde2aa..5275981e 100644 --- a/mediagoblin/media_types/image/processing.py +++ b/mediagoblin/media_types/image/processing.py @@ -29,7 +29,7 @@ _log = logging.getLogger(__name__) SUPPORTED_FILETYPES = ['png', 'gif', 'jpg', 'jpeg'] 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) clean_ext = ext[1:].lower() # Strip the . from ext and make lowercase