1
1
import sys
2
2
from builtins import object as _object
3
- from importlib .abc import Loader , PathEntryFinder
3
+ from importlib .abc import PathEntryFinder
4
4
from importlib .machinery import ModuleSpec
5
5
from io import TextIOWrapper
6
6
from types import FrameType , ModuleType , TracebackType
@@ -26,12 +26,10 @@ _T = TypeVar("_T")
26
26
# The following type alias are stub-only and do not exist during runtime
27
27
_ExcInfo = Tuple [Type [BaseException ], BaseException , TracebackType ]
28
28
_OptExcInfo = Union [_ExcInfo , Tuple [None , None , None ]]
29
- _PathSequence = Sequence [Union [bytes , str ]]
30
29
31
- # Unlike importlib.abc.MetaPathFinder, invalidate_caches() might not exist (see python docs)
30
+ # Intentionally omits one deprecated and one optional method of `importlib.abc.MetaPathFinder`
32
31
class _MetaPathFinder (Protocol ):
33
- def find_module (self , fullname : str , path : _PathSequence | None ) -> Loader | None : ...
34
- def find_spec (self , fullname : str , path : _PathSequence | None , target : ModuleType | None = ...) -> ModuleSpec | None : ...
32
+ def find_spec (self , fullname : str , path : Sequence [str ] | None , target : ModuleType | None = ...) -> ModuleSpec | None : ...
35
33
36
34
# ----- sys variables -----
37
35
if sys .platform != "win32" :
0 commit comments