Commit bb239c08 authored by Jason R. Coombs's avatar Jason R. Coombs

Use _call_aside to signal early that the function is called immediately.

parent a78cfe13
......@@ -3051,15 +3051,23 @@ def _mkstemp(*args,**kw):
warnings.filterwarnings("ignore", category=PEP440Warning, append=True)
# Set up global resource manager (deliberately not state-saved)
_manager = ResourceManager()
# from jaraco.functools 1.3
def _call_aside(f, *args, **kwargs):
f(*args, **kwargs)
return f
@functools.partial(_call_aside, globals())
def _initialize(g):
for name in dir(_manager):
"Set up global resource manager (deliberately not state-saved)"
manager = ResourceManager()
g['_manager'] = manager
for name in dir(manager):
if not name.startswith('_'):
g[name] = getattr(_manager, name)
_initialize(globals())
g[name] = getattr(manager, name)
@_call_aside
def _initialize_master_working_set():
"""
Prepare the master working set and make the ``require()``
......@@ -3089,4 +3097,3 @@ def _initialize_master_working_set():
# match order
list(map(working_set.add_entry, sys.path))
globals().update(locals())
_initialize_master_working_set()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment