python-matplotlib/20_matplotlibrc_path_search...

25 lines
1017 B
Diff
Raw Normal View History

--- a/lib/matplotlib/__init__.py 2016-04-04 12:54:26.427194940 +0200
+++ b/lib/matplotlib/__init__.py 2016-04-04 12:56:12.662590255 +0200
2017-09-28 05:15:02 +00:00
@@ -713,9 +713,12 @@ def _get_data_path():
_file = _decode_filesystem_path(__file__)
path = os.sep.join([os.path.dirname(_file), 'mpl-data'])
+ path = '/usr/share/matplotlib/mpl-data'
if os.path.isdir(path):
return path
+ raise RuntimeError('Could not find the matplotlib data files')
+
# setuptools' namespace_packages may highjack this init file
# so need to try something known to be in matplotlib, not basemap
import matplotlib.afm
2017-09-28 05:15:02 +00:00
@@ -843,7 +846,7 @@ def matplotlib_fname():
home, '.matplotlib', 'matplotlibrc')
return fname
- path = get_data_path() # guaranteed to exist or raise
+ path = '/etc' # guaranteed to exist or raise
fname = os.path.join(path, 'matplotlibrc')
if not os.path.exists(fname):
warnings.warn('Could not find matplotlibrc; using defaults')