Close fp before replacing

This commit is contained in:
Andrew Murray 2018-11-13 22:24:59 +11:00
parent b637b5f7a2
commit c0ee319af1

View File

@ -26,6 +26,7 @@ class TestFileCur(PillowTestCase):
no_cursors_file = "Tests/images/no_cursors.cur"
cur = CurImagePlugin.CurImageFile(TEST_FILE)
cur.fp.close()
with open(no_cursors_file, "rb") as cur.fp:
self.assertRaises(TypeError, cur._open)