1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
From 425309281d1b8e3d454f548b2ac24706ec8e280a Mon Sep 17 00:00:00 2001
From: Sandro Tosi <morph@debian.org>
Date: Thu, 8 Oct 2015 09:47:11 -0700
Subject: Fixes the path to search for matplotlibrc file
Forwarded: not-needed
Patch-Name: 20_matplotlibrc_path_search_fix.patch
---
lib/matplotlib/__init__.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
index 004cc59..845a3bd 100644
--- a/lib/matplotlib/__init__.py
+++ b/lib/matplotlib/__init__.py
@@ -712,10 +712,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
@@ -843,7 +845,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')
|