We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 335c1bc commit 8241422Copy full SHA for 8241422
Lib/test/test_capi/test_file.py
@@ -26,12 +26,14 @@ def __fspath__(self):
26
data = _testcapi.py_fopen(FSPath(filename), "rb")
27
self.assertEqual(data, source[:256])
28
29
- for filename in (
+ filenames = [
30
os_helper.TESTFN,
31
os.fsencode(os_helper.TESTFN),
32
- os_helper.TESTFN_UNDECODABLE,
33
- os_helper.TESTFN_UNENCODABLE,
34
- ):
+ ]
+ # TESTFN_UNDECODABLE cannot be used to create a file on macOS/WASI.
+ if os_helper.TESTFN_UNENCODABLE is not None:
35
+ filenames.append(os_helper.TESTFN_UNENCODABLE)
36
+ for filename in filenames:
37
with self.subTest(filename=filename):
38
try:
39
with open(filename, "wb") as fp:
0 commit comments