File: 20_matplotlibrc_path_search_fix.patch

package info (click to toggle)
matplotlib 3.10.1%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 78,340 kB
  • sloc: python: 147,118; cpp: 62,988; objc: 1,679; ansic: 1,426; javascript: 786; makefile: 92; sh: 53
file content (35 lines) | stat: -rw-r--r-- 1,130 bytes parent folder | download | duplicates (2)
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
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(-)

--- a/lib/matplotlib/__init__.py
+++ b/lib/matplotlib/__init__.py
@@ -590,7 +590,11 @@
 @_logged_cached('matplotlib data path: %s')
 def get_data_path():
     """Return the path to Matplotlib data."""
-    return str(Path(__file__).with_name("mpl-data"))
+    _data_path = Path(__file__).with_name("mpl-data")
+    if _data_path.exists():
+        return str(_data_path)
+    else:
+        return '/usr/share/matplotlib/mpl-data'
 
 
 def matplotlib_fname():
@@ -628,7 +632,7 @@
             yield matplotlibrc
             yield os.path.join(matplotlibrc, 'matplotlibrc')
         yield os.path.join(get_configdir(), 'matplotlibrc')
-        yield os.path.join(get_data_path(), 'matplotlibrc')
+        yield '/etc/matplotlibrc'
 
     for fname in gen_candidates():
         if os.path.exists(fname) and not os.path.isdir(fname):