File: 20_matplotlibrc_path_search_fix.patch

package info (click to toggle)
matplotlib 1.1.1~rc2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 66,076 kB
  • sloc: python: 90,600; cpp: 69,891; objc: 5,231; ansic: 1,723; makefile: 171; sh: 7
file content (31 lines) | stat: -rw-r--r-- 1,285 bytes parent folder | download
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
Description: Fixes the path to search for matplotlibrc file
Forwarded: not-needed
Author: Sandro Tosi <morph@debian.org>

Index: matplotlib-1.1.0~rc1/lib/matplotlib/__init__.py
===================================================================
--- matplotlib-1.1.0~rc1.orig/lib/matplotlib/__init__.py	2011-09-24 17:08:26.000000000 +0200
+++ matplotlib-1.1.0~rc1/lib/matplotlib/__init__.py	2011-09-26 23:45:59.369692360 +0200
@@ -485,10 +485,12 @@
             raise RuntimeError('Path in environment MATPLOTLIBDATA not a directory')
         return path
 
-    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
@@ -596,7 +598,7 @@
     if os.path.exists(fname): 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')