mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Add initial implementation of importlib. See the NOTES files for what is
planned for the package. There are no docs yet, but they are coming once the API for the first new function, importlib.import_module() is finalized.
This commit is contained in:
parent
458ad47a2c
commit
23cbd8a656
35 changed files with 3360 additions and 0 deletions
24
Lib/importlib/test/frozen/support.py
Normal file
24
Lib/importlib/test/frozen/support.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
import sys
|
||||
|
||||
|
||||
class Null:
|
||||
|
||||
"""Just absorb what is given."""
|
||||
|
||||
def __getattr__(self):
|
||||
return lambda *args, **kwargs: None
|
||||
|
||||
|
||||
class SilenceStdout:
|
||||
|
||||
"""Silence sys.stdout."""
|
||||
|
||||
def setUp(self):
|
||||
"""Substitute sys.stdout with something that does not print to the
|
||||
screen thanks to what bytecode is frozen."""
|
||||
sys.stdout = Null()
|
||||
super().setUp()
|
||||
|
||||
def tearDown(self):
|
||||
sys.stdout = sys.__stdout__
|
||||
super().tearDown()
|
Loading…
Add table
Add a link
Reference in a new issue