mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 17:24:31 +03:00
Restored original state using finally
Co-authored-by: Ondrej Baranovič <nulano@nulano.eu>
This commit is contained in:
parent
8caae8739f
commit
e2d1b2663d
|
@ -35,7 +35,9 @@ class TestDefaultFontLeak(TestTTypeFontLeak):
|
||||||
def test_leak(self):
|
def test_leak(self):
|
||||||
if features.check_module("freetype2"):
|
if features.check_module("freetype2"):
|
||||||
ImageFont.core = _util.DeferredError(ImportError)
|
ImageFont.core = _util.DeferredError(ImportError)
|
||||||
default_font = ImageFont.load_default()
|
try:
|
||||||
ImageFont.core = original_core
|
default_font = ImageFont.load_default()
|
||||||
|
finally:
|
||||||
|
ImageFont.core = original_core
|
||||||
|
|
||||||
self._test_font(default_font)
|
self._test_font(default_font)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user