File tree Expand file tree Collapse file tree 5 files changed +9
-6
lines changed
importlib_resources/tests Expand file tree Collapse file tree 5 files changed +9
-6
lines changed Original file line number Diff line number Diff line change
1
+ """
2
+ Backward-compatability shims to support Python 3.9 and earlier.
3
+ """
4
+
1
5
import os
2
6
3
7
4
8
try :
5
9
from test .support import import_helper # type: ignore
6
10
except ImportError :
7
- # Python 3.9 and earlier
11
+
8
12
class import_helper : # type: ignore
9
13
from test .support import (
10
14
modules_setup ,
@@ -17,13 +21,12 @@ class import_helper: # type: ignore
17
21
try :
18
22
from test .support import os_helper # type: ignore
19
23
except ImportError :
20
- # Python 3.9 compat
24
+
21
25
class os_helper : # type:ignore
22
26
from test .support import temp_dir
23
27
24
28
25
29
try :
26
- # Python 3.10
27
30
from test .support .os_helper import unlink
28
31
except ImportError :
29
32
from test .support import unlink as _unlink
Original file line number Diff line number Diff line change 6
6
from .. import abc
7
7
from ..abc import TraversableResources , ResourceReader
8
8
from . import util
9
- from ._compat import os_helper
9
+ from .compat . py39 import os_helper
10
10
11
11
12
12
class SimpleLoader :
Original file line number Diff line number Diff line change 9
9
from . import data01
10
10
from . import util
11
11
from . import _path
12
- from ._compat import os_helper , import_helper
12
+ from .compat . py39 import os_helper , import_helper
13
13
14
14
15
15
@contextlib .contextmanager
Original file line number Diff line number Diff line change 8
8
9
9
from . import data01
10
10
from ..abc import ResourceReader
11
- from ._compat import import_helper , os_helper
11
+ from .compat . py39 import import_helper , os_helper
12
12
from . import zip as zip_
13
13
14
14
You can’t perform that action at this time.
0 commit comments