Skip to content

Commit 4daebe8

Browse files
committed
FS_NONASCII moves to test.support.os_helper in Python 3.10, so add a compatibility shim to support both sides.
1 parent 7ea08d0 commit 4daebe8

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

tests/fixtures.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
import shutil
66
import tempfile
77
import textwrap
8-
import test.support
8+
9+
from .py39compat import FS_NONASCII
910

1011
from importlib_metadata._compat import pathlib, contextlib
1112

@@ -218,7 +219,7 @@ def build_files(file_defs, prefix=pathlib.Path()):
218219

219220
class FileBuilder:
220221
def unicode_filename(self):
221-
return test.support.FS_NONASCII or \
222+
return FS_NONASCII or \
222223
self.skip("File system does not support non-ascii.")
223224

224225

tests/py39compat.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
try:
2+
from test.support.os_helpers import FS_NONASCII
3+
except ImportError:
4+
from test.support import FS_NONASCII # noqa

0 commit comments

Comments
 (0)