Skip to content

Commit 9f821d1

Browse files
committed
Include cache version in fontlist cache filename.
1 parent e732310 commit 9f821d1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ per-file-ignores =
4242
matplotlib/backends/qt_editor/formlayout.py: E301, E501
4343
matplotlib/backends/tkagg.py: E231, E302, E701
4444
matplotlib/backends/windowing.py: E301, E302
45-
matplotlib/font_manager.py: E203, E221, E225, E251, E261, E262, E302, E501
45+
matplotlib/font_manager.py: E203, E221, E251, E261, E262, E302, E501
4646
matplotlib/fontconfig_pattern.py: E201, E203, E221, E222, E225, E302
4747
matplotlib/legend_handler.py: E201, E501
4848
matplotlib/mathtext.py: E201, E202, E203, E211, E221, E222, E225, E231, E251, E261, E301, E302, E303, E402, E501

lib/matplotlib/font_manager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ class FontManager(object):
945945
# Increment this version number whenever the font cache data
946946
# format or behavior has changed and requires a existing font
947947
# cache files to be rebuilt.
948-
__version__ = 201
948+
__version__ = 300
949949

950950
def __init__(self, size=None, weight='normal'):
951951
self._version = self.__version__
@@ -1333,7 +1333,8 @@ def findfont(prop, fontext='ttf'):
13331333

13341334
cachedir = get_cachedir()
13351335
if cachedir is not None:
1336-
_fmcache = os.path.join(cachedir, 'fontList.json')
1336+
_fmcache = os.path.join(
1337+
cachedir, 'fontlist-v{}.json'.format(FontManager.__version__))
13371338

13381339
fontManager = None
13391340

0 commit comments

Comments
 (0)