Browse Source

fix in ImageWrapper destructor

Dimitri Korsch 6 năm trước cách đây
mục cha
commit
f2fe513396
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      nabirds/dataset/image.py

+ 2 - 1
nabirds/dataset/image.py

@@ -34,7 +34,8 @@ class ImageWrapper(object):
 		self._feature = None
 
 	def __del__(self):
-		self._im.close()
+		if isinstance(self._im, Image.Image):
+			self._im.close()
 
 	@property
 	def im(self):