Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2c8dada

Browse filesBrowse files
authored
Merge pull request matplotlib#25277 from ksunden/auto-backport-of-pr-25268-on-v3.7.x
Backport PR matplotlib#25268 on branch v3.7.x (Fix import of styles with relative path)
2 parents c70ddbc + 0b9441d commit 2c8dada
Copy full SHA for 2c8dada

File tree

Expand file treeCollapse file tree

2 files changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-1
lines changed

‎lib/matplotlib/style/core.py

Copy file name to clipboardExpand all lines: lib/matplotlib/style/core.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def use(style):
153153
path = (importlib_resources.files(pkg)
154154
/ f"{name}.{STYLE_EXTENSION}")
155155
style = _rc_params_in_file(path)
156-
except (ModuleNotFoundError, IOError) as exc:
156+
except (ModuleNotFoundError, OSError, TypeError) as exc:
157157
# There is an ambiguity whether a dotted name refers to a
158158
# package.style_name or to a dotted file path. Currently,
159159
# we silently try the first form and then the second one;

‎lib/matplotlib/tests/test_style.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_style.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,5 @@ def test_style_from_module(tmp_path, monkeypatch):
205205
assert mpl.rcParams["lines.linewidth"] == 42
206206
mpl.style.use("mpl_test_style_pkg.mplstyle")
207207
assert mpl.rcParams["lines.linewidth"] == 84
208+
mpl.style.use("./mpl_test_style_pkg.mplstyle")
209+
assert mpl.rcParams["lines.linewidth"] == 84

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.