vp-build/srcpkgs/python-matplotlib/patches/20_matplotlibrc_path_search...

30 lines
1.1 KiB
Diff

Description: Fixes the path to search for matplotlibrc file
Forwarded: not-needed
Author: Sandro Tosi <morph@debian.org>
--- ./lib/matplotlib/__init__.py
+++ ./lib/matplotlib/__init__.py
@@ -681,10 +681,12 @@ def _get_data_path():
return 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
@@ -812,7 +814,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')