Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0134e6d

Browse files
authored
Merge pull request #25792 from scottshambaugh/wsl_expected_images
Fix broken symlinks for expected images on WSL
2 parents 212caa0 + aa0cda7 commit 0134e6d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matplotlib/testing/decorators.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import functools
33
import inspect
44
import os
5+
from platform import uname
56
from pathlib import Path
67
import shutil
78
import string
@@ -135,6 +136,8 @@ def copy_baseline(self, baseline, extension):
135136
with contextlib.suppress(OSError):
136137
os.remove(expected_fname)
137138
try:
139+
if 'microsoft' in uname().release.lower():
140+
raise OSError # On WSL, symlink breaks silently
138141
os.symlink(orig_expected_path, expected_fname)
139142
except OSError: # On Windows, symlink *may* be unavailable.
140143
shutil.copyfile(orig_expected_path, expected_fname)

0 commit comments

Comments
 (0)