File tree Expand file tree Collapse file tree 2 files changed +6
-26
lines changed
importlib_resources/tests/compat Expand file tree Collapse file tree 2 files changed +6
-26
lines changed Original file line number Diff line number Diff line change 2
2
Backward-compatability shims to support Python 3.9 and earlier.
3
3
"""
4
4
5
- import types
5
+ from jaraco . test . cpython import from_test_support , try_import
6
6
7
- from jaraco .collections import Projection
8
-
9
-
10
- def from_test_support (* names ):
11
- """
12
- Return a SimpleNamespace of names from test.support.
13
- """
14
- import test .support
15
-
16
- return types .SimpleNamespace (** Projection (names , vars (test .support )))
17
-
18
-
19
- try :
20
- from test .support import import_helper # type: ignore
21
- except ImportError :
22
- import_helper = from_test_support (
23
- 'modules_setup' , 'modules_cleanup' , 'DirsOnSysPath'
24
- )
25
-
26
-
27
- try :
28
- from test .support import os_helper # type: ignore
29
- except ImportError :
30
- os_helper = from_test_support ('temp_dir' )
7
+ import_helper = try_import ('import_helper' ) or from_test_support (
8
+ 'modules_setup' , 'modules_cleanup' , 'DirsOnSysPath'
9
+ )
10
+ os_helper = try_import ('os_helper' ) or from_test_support ('temp_dir' )
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ testing =
34
34
35
35
# local
36
36
zipp >= 3.17
37
- jaraco.collections
37
+ jaraco.test >= 5.4
38
38
39
39
docs =
40
40
# upstream
You can’t perform that action at this time.
0 commit comments