Closed brl0 closed 5 years ago
How did you produce this error? Would be great to have a test for this.
Also, what happens if there are multiple objects with no __name__
? Won't they clash in the context dictionary?
Great point about multiple modules with blank names, haven't tested that yet but you are right about the blank name collision issue. I'll see if I can get the object hash id to use instead, or any other method you prefer to resolve collisions.
The error occurred when trying to add a third-party logging module, loguru, to the .konchrc file.
To install loguru:
pip install loguru
Import statement added to .konchrc file:
from loguru import logger
This appears to now have two unrelated changes: the __name__
fix and the get_config
change (which I'm not sure is necessary). Can you split these out into separate PRs please?
Created function get_obj_name to try to get the name attribute, otherwise return empty string.