Close file after reading in ImagePalette.load()

Fixes some "ResourceWarning: unclosed file ..." when running tests with
warnings enabled.
This commit is contained in:
Jon Dufresne 2016-11-11 16:59:32 -08:00
parent 76d156bef0
commit 6bc8fdd342

View File

@ -197,7 +197,7 @@ def load(filename):
# FIXME: supports GIMP gradients only
fp = open(filename, "rb")
with open(filename, "rb") as fp:
for paletteHandler in [
GimpPaletteFile.GimpPaletteFile,