Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec6330b commit 1d1660fCopy full SHA for 1d1660f
1 file changed
lib/matplotlib/tests/test_font_manager.py
@@ -31,11 +31,15 @@ def test_font_priority():
31
def test_json_serialization():
32
# on windows, we can't open a file twice, so save the name and unlink
33
# manually...
34
- with tempfile.NamedTemporaryFile(delete=False) as temp:
35
- name = temp.name
36
- json_dump(fontManager, name)
37
- copy = json_load(name)
38
- os.remove(name)
+ try:
+ name = None
+ with tempfile.NamedTemporaryFile(delete=False) as temp:
+ name = temp.name
+ json_dump(fontManager, name)
39
+ copy = json_load(name)
40
+ finally:
41
+ if name and os.path.exists(name):
42
+ os.remove(name)
43
with warnings.catch_warnings():
44
warnings.filterwarnings('ignore', 'findfont: Font family.*not found')
45
for prop in ({'family': 'STIXGeneral'},
0 commit comments