Skip to content

Commit 414e4c0

Browse files
committed
Use a SimpleNamespace for setdefault compatibility.
1 parent f3f4b0a commit 414e4c0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

importlib_resources/tests/compat/py39.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
"""
44

55
import os
6+
import types
7+
8+
from jaraco.collections import Projection
69

710

811
try:
912
from test.support import import_helper # type: ignore
1013
except ImportError:
14+
import test.support
1115

12-
class import_helper: # type: ignore
13-
from test.support import (
14-
modules_setup,
15-
modules_cleanup,
16-
DirsOnSysPath,
17-
)
16+
names = 'modules_setup', 'modules_cleanup', 'DirsOnSysPath'
17+
import_helper = types.SimpleNamespace(**Projection(names, vars(test.support)))
1818

1919

2020
try:

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ testing =
3434

3535
# local
3636
zipp >= 3.17
37+
jaraco.collections
3738

3839
docs =
3940
# upstream

0 commit comments

Comments
 (0)