Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove __ret_value__ prior to writing to console #1057

Merged
merged 1 commit into from
Apr 16, 2021

Conversation

iamdefinitelyahuman
Copy link
Member

What I did

Fix a recursion error within the console when attempting to print the output of globals() or locals().

Fixes #1014

How I did it

The bug was due to how console output is generated - under the hood, globals() is mutated to __ret_value__ = globals() and then __ret_value__ is printed. However, because the return value contains __ret_value__ we end up dying recursion death as we try to format dict-inside-dict-inside-dict.

The fix is simply to remove __ret_value__ from locals prior to generating the console output.

How to verify it

Open the console and type locals() or globals().

@iamdefinitelyahuman iamdefinitelyahuman merged commit f4ba974 into master Apr 16, 2021
@iamdefinitelyahuman iamdefinitelyahuman deleted the fix-console-globals branch April 16, 2021 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

__repr__ bug in brownie console
1 participant