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 ad6431e

Browse filesBrowse files
committed
Check Axes/Figure import paths in boilerplate.py
1 parent 3274d6a commit ad6431e
Copy full SHA for ad6431e

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+9
-1
lines changed

‎tools/boilerplate.py

Copy file name to clipboardExpand all lines: tools/boilerplate.py
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,5 +459,13 @@ def update_sig_from_node(node, sig):
459459
if len(sys.argv) > 1:
460460
pyplot_path = Path(sys.argv[1])
461461
else:
462-
pyplot_path = Path(__file__).parent / "../lib/matplotlib/pyplot.py"
462+
mpl_path = (Path(__file__).parent / ".." /"lib"/"matplotlib").resolve()
463+
pyplot_path = mpl_path / "pyplot.py"
464+
for cls in [Axes, Figure]:
465+
if mpl_path not in Path(inspect.getfile(cls)).parents:
466+
raise RuntimeError(
467+
f"{cls.__name__} import path is not {mpl_path}.\n"
468+
"Please make sure your Matplotlib installation "
469+
"is from the same source checkout as boilerplate.py"
470+
)
463471
build_pyplot(pyplot_path)

0 commit comments

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