FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[Original HTTPS Page]
cpython/Lib/importlib/machinery.py at main · python/cpython · GitHub
python
cpython
Repository navigation
Code
Issues
5k+
(5k+)
Pull requests
2.7k
(2.7k)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cpython
/
Lib
/
importlib
/
machinery.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
53 lines (43 loc) · 2.18 KB
Breadcrumbs
cpython
/
Lib
/
importlib
/
machinery.py
Copy path
File metadata and controls
53 lines (43 loc) · 2.18 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
"""The machinery of importlib: finders, loaders, hooks, etc."""
lazy
import
warnings
# Public API
from
.
_bootstrap
import
ModuleSpec
from
.
_bootstrap
import
BuiltinImporter
from
.
_bootstrap
import
FrozenImporter
from
.
_bootstrap_external
import
(
SOURCE_SUFFIXES
,
BYTECODE_SUFFIXES
,
EXTENSION_SUFFIXES
,
DEBUG_BYTECODE_SUFFIXES
as
_DEBUG_BYTECODE_SUFFIXES
,
OPTIMIZED_BYTECODE_SUFFIXES
as
_OPTIMIZED_BYTECODE_SUFFIXES
)
from
.
_bootstrap_external
import
WindowsRegistryFinder
from
.
_bootstrap_external
import
PathFinder
from
.
_bootstrap_external
import
FileFinder
from
.
_bootstrap_external
import
SourceFileLoader
from
.
_bootstrap_external
import
SourcelessFileLoader
from
.
_bootstrap_external
import
ExtensionFileLoader
from
.
_bootstrap_external
import
AppleFrameworkLoader
from
.
_bootstrap_external
import
NamespaceLoader
from
.
_bootstrap_external
import
NamespacePath
def
all_suffixes
():
"""Returns a list of all recognized module suffixes for this process"""
return
SOURCE_SUFFIXES
+
BYTECODE_SUFFIXES
+
EXTENSION_SUFFIXES
__all__
=
[
'AppleFrameworkLoader'
,
'BYTECODE_SUFFIXES'
,
'BuiltinImporter'
,
'DEBUG_BYTECODE_SUFFIXES'
,
'EXTENSION_SUFFIXES'
,
'ExtensionFileLoader'
,
'FileFinder'
,
'FrozenImporter'
,
'ModuleSpec'
,
'NamespaceLoader'
,
'OPTIMIZED_BYTECODE_SUFFIXES'
,
'PathFinder'
,
'SOURCE_SUFFIXES'
,
'SourceFileLoader'
,
'SourcelessFileLoader'
,
'WindowsRegistryFinder'
,
'all_suffixes'
]
def
__getattr__
(
name
):
if
name
==
'DEBUG_BYTECODE_SUFFIXES'
:
warnings
.
warn
(
'importlib.machinery.DEBUG_BYTECODE_SUFFIXES is '
'deprecated; use importlib.machinery.BYTECODE_SUFFIXES '
'instead.'
,
DeprecationWarning
,
stacklevel
=
2
)
return
_DEBUG_BYTECODE_SUFFIXES
elif
name
==
'OPTIMIZED_BYTECODE_SUFFIXES'
:
warnings
.
warn
(
'importlib.machinery.OPTIMIZED_BYTECODE_SUFFIXES is '
'deprecated; use importlib.machinery.BYTECODE_SUFFIXES '
'instead.'
,
DeprecationWarning
,
stacklevel
=
2
)
return
_OPTIMIZED_BYTECODE_SUFFIXES
raise
AttributeError
(
f'module
{
__name__
!r
}
has no attribute
{
name
!r
}
'
)
Back
|
FazBrowse Home
|
New Git URL