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 4ff3d45

Browse filesBrowse files
authored
Merge pull request #26585 from meeseeksmachine/auto-backport-of-pr-26576-on-v3.8.x
Backport PR #26576 on branch v3.8.x (Use sys.platform over os.name)
2 parents b9ea667 + 0b81f6c commit 4ff3d45
Copy full SHA for 4ff3d45

File tree

5 files changed

+8
-7
lines changed
Filter options

5 files changed

+8
-7
lines changed

‎lib/matplotlib/dviread.py

Copy file name to clipboardExpand all lines: lib/matplotlib/dviread.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ def find_tex_file(filename):
10861086
if lk:
10871087
path = lk.search(filename)
10881088
else:
1089-
if os.name == 'nt':
1089+
if sys.platform == 'win32':
10901090
# On Windows only, kpathsea can use utf-8 for cmd args and output.
10911091
# The `command_line_encoding` environment variable is set to force
10921092
# it to always use utf-8 encoding. See Matplotlib issue #11848.

‎lib/matplotlib/tests/test_animation.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_animation.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from pathlib import Path
33
import platform
44
import re
5+
import shutil
56
import subprocess
67
import sys
78
import weakref
@@ -318,7 +319,7 @@ def test_cleanup_temporaries(method_name, tmpdir, anim):
318319
assert list(Path(str(tmpdir)).iterdir()) == []
319320

320321

321-
@pytest.mark.skipif(os.name != "posix", reason="requires a POSIX OS")
322+
@pytest.mark.skipif(shutil.which("/bin/sh") is None, reason="requires a POSIX OS")
322323
def test_failing_ffmpeg(tmpdir, monkeypatch, anim):
323324
"""
324325
Test that we correctly raise a CalledProcessError when ffmpeg fails.

‎lib/matplotlib/tests/test_backend_webagg.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_backend_webagg.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def test_webagg_fallback(backend):
1111
if backend == "nbagg":
1212
pytest.importorskip("IPython")
1313
env = dict(os.environ)
14-
if os.name != "nt":
14+
if sys.platform != "win32":
1515
env["DISPLAY"] = ""
1616

1717
env["MPLBACKEND"] = backend

‎lib/matplotlib/tests/test_backends_interactive.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_backends_interactive.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ def test_cross_Qt_imports():
473473

474474
@pytest.mark.skipif('TF_BUILD' in os.environ,
475475
reason="this test fails an azure for unknown reasons")
476-
@pytest.mark.skipif(os.name == "nt", reason="Cannot send SIGINT on Windows.")
476+
@pytest.mark.skipif(sys.platform == "win32", reason="Cannot send SIGINT on Windows.")
477477
def test_webagg():
478478
pytest.importorskip("tornado")
479479
proc = subprocess.Popen(

‎lib/matplotlib/tests/test_matplotlib.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_matplotlib.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ def test_parse_to_version_info(version_str, version_tuple):
1717
assert matplotlib._parse_to_version_info(version_str) == version_tuple
1818

1919

20-
@pytest.mark.skipif(
21-
os.name == "nt", reason="chmod() doesn't work as is on Windows")
22-
@pytest.mark.skipif(os.name != "nt" and os.geteuid() == 0,
20+
@pytest.mark.skipif(sys.platform == "win32",
21+
reason="chmod() doesn't work as is on Windows")
22+
@pytest.mark.skipif(sys.platform != "win32" and os.geteuid() == 0,
2323
reason="chmod() doesn't work as root")
2424
def test_tmpconfigdir_warning(tmpdir):
2525
"""Test that a warning is emitted if a temporary configdir must be used."""

0 commit comments

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