[Python-modules-commits] [matplotlib] 03/13: Fixes the path to search for matplotlibrc file

Sandro Tosi morph at moszumanska.debian.org
Sun Feb 7 22:04:17 UTC 2016


This is an automated email from the git hooks/post-receive script.

morph pushed a commit to branch master
in repository matplotlib.

commit 8e7640243d4024d16af51029b8144cbf085fae11
Author: Sandro Tosi <morph at debian.org>
Date:   Thu Oct 8 09:47:11 2015 -0700

    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 737d510..6c2dff9 100644
--- a/lib/matplotlib/__init__.py
+++ b/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')

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/matplotlib.git



More information about the Python-modules-commits mailing list