Skip to content
Snippets Groups Projects
Commit 1b7eb9d4 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

do not propogate __ variables when config chain loading

Fixes #76
parent 3075726b
Branches
Tags
1 merge request!137do not propogate __ variables when config chain loading
Pipeline #58894 passed
...@@ -227,7 +227,9 @@ def load(paths, context=None, entry_point_group=None, attribute_name=None): ...@@ -227,7 +227,9 @@ def load(paths, context=None, entry_point_group=None, attribute_name=None):
# remove the keys that might break the loading of the next config file. # remove the keys that might break the loading of the next config file.
ctxt.__dict__.pop('__name__', None) ctxt.__dict__.pop('__name__', None)
ctxt.__dict__.pop('__package__', None) ctxt.__dict__.pop('__package__', None)
mod.__dict__.update(ctxt.__dict__) # do not propogate __ variables
context = {k: v for k, v in ctxt.__dict__.items() if not k.startswith('__')}
mod.__dict__.update(context)
LOADED_CONFIGS.append(mod) LOADED_CONFIGS.append(mod)
ctxt = _load_context(k, mod) ctxt = _load_context(k, mod)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment