aboutsummaryrefslogtreecommitdiff
path: root/pkg_resources/_vendor/importlib_resources/tests/_compat.py
diff options
context:
space:
mode:
Diffstat (limited to 'pkg_resources/_vendor/importlib_resources/tests/_compat.py')
-rw-r--r--pkg_resources/_vendor/importlib_resources/tests/_compat.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/pkg_resources/_vendor/importlib_resources/tests/_compat.py b/pkg_resources/_vendor/importlib_resources/tests/_compat.py
new file mode 100644
index 0000000..4c99cff
--- /dev/null
+++ b/pkg_resources/_vendor/importlib_resources/tests/_compat.py
@@ -0,0 +1,19 @@
+import os
+
+
+try:
+ from test.support import import_helper # type: ignore
+except ImportError:
+ # Python 3.9 and earlier
+ class import_helper: # type: ignore
+ from test.support import modules_setup, modules_cleanup
+
+
+try:
+ # Python 3.10
+ from test.support.os_helper import unlink
+except ImportError:
+ from test.support import unlink as _unlink
+
+ def unlink(target):
+ return _unlink(os.fspath(target))