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

Merge branch 'issue-45' into 'master'

Fixed issue with the gc

Closes #45

See merge request !57
parents 7518f6cb a957d848
Branches
Tags
1 merge request!57Fixed issue with the gc
Pipeline #
...@@ -9,6 +9,7 @@ import logging ...@@ -9,6 +9,7 @@ import logging
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
loaded_configs = []
def _load_context(path, mod): def _load_context(path, mod):
'''Loads the Python file as module, returns a resolved context '''Loads the Python file as module, returns a resolved context
...@@ -77,4 +78,8 @@ def load(paths, context=None): ...@@ -77,4 +78,8 @@ def load(paths, context=None):
logger.debug("Loading configuration file `%s'...", k) logger.debug("Loading configuration file `%s'...", k)
mod = _load_context(k, mod) mod = _load_context(k, mod)
# Small gambiarra (https://www.urbandictionary.com/define.php?term=Gambiarra)
# to avoid the gc to collect some already imported modules
loaded_configs.append(mod)
return mod return mod
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment