Skip to content

Commit

Permalink
Remove matplotlib's font cache. Fixes pyfa-org#234
Browse files Browse the repository at this point in the history
  • Loading branch information
blitzmann committed Aug 5, 2015
1 parent cc59612 commit ab7bbcb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gui/graphFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#===============================================================================

import wx
import os
import bitmapLoader
import gui.display
import gui.globalEvents as GE
Expand All @@ -41,6 +42,11 @@ def __init__(self, parent, style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_

try:
import matplotlib as mpl
cache_dir = mpl._get_cachedir()
cache_file = os.path.join(cache_dir, 'fontList.cache')
if os.access(cache_dir, os.W_OK | os.X_OK) and os.path.isfile(cache_file):
# remove matplotlib font cache, see #234
os.remove(cache_file)
if not mplImported:
mpl.use('wxagg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as Canvas
Expand Down

0 comments on commit ab7bbcb

Please sign in to comment.