class documentation
Importer that restricts modules.
Method | __init__ |
Create importer. |
Method | applied |
Context manager to apply this restrictive import. |
Instance Variable | import |
Undocumented |
Instance Variable | modules |
Undocumented |
Instance Variable | new |
Undocumented |
Instance Variable | restricted |
Undocumented |
Instance Variable | restriction |
Undocumented |
Instance Variable | restrictions |
Undocumented |
Method | _assert |
Undocumented |
Method | _builtins |
Undocumented |
Method | _builtins |
Undocumented |
Method | _import |
Undocumented |
Method | _maybe |
Undocumented |
Method | _maybe |
Implements _Environment.maybe_restrict_module . |
Method | _traced |
Undocumented |
Method | _unapplied |
Undocumented |
def __init__(self, restrictions:
SandboxRestrictions
, restriction_context: RestrictionContext
):
(source)
¶
Create importer.
Context manager to apply this restrictive import.
Warning
This currently alters global sys.modules and builtins.__import__ while it is running and therefore should be locked against other code running at the same time.
def _import(self, name:
str
, globals: Optional[ Mapping[ str, object]]
= None, locals: Optional[ Mapping[ str, object]]
= None, fromlist: Sequence[ str]
= (), level: int
= 0) -> types.ModuleType
:
(source)
¶
Undocumented