From 0a256f9e56140311ec10abbff3123586f1b541a6 Mon Sep 17 00:00:00 2001 From: homm Date: Wed, 15 Jan 2014 16:55:10 +0400 Subject: [PATCH] fix UnboundLocalError: local variable 't' referenced before assignment --- PIL/ImageFile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PIL/ImageFile.py b/PIL/ImageFile.py index 70762b4b0..a63fe757e 100644 --- a/PIL/ImageFile.py +++ b/PIL/ImageFile.py @@ -229,7 +229,7 @@ class ImageFile(Image.Image): self.fp = None # might be shared - if (not LOAD_TRUNCATED_IMAGES or t == 0) and not self.map and e < 0: + if not self.map and (not LOAD_TRUNCATED_IMAGES or t == 0) and e < 0: # still raised if decoder fails to return anything raise_ioerror(e)