We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26a1cd4 commit 0558275Copy full SHA for 0558275
Lib/test/test_traceback.py
@@ -4232,8 +4232,8 @@ def make_module(self, code):
4232
4233
return mod_name
4234
4235
- def get_import_from_suggestion(self, mod_dict, name):
4236
- modname = self.make_module(mod_dict)
+ def get_import_from_suggestion(self, code, name):
+ modname = self.make_module(code)
4237
4238
def callable():
4239
try:
@@ -4416,8 +4416,9 @@ def func():
4416
def test_name_error_suggestions_with_non_string_candidates(self):
4417
def func():
4418
abc = 1
4419
- globals()[0] = 1
4420
- abv
+ custom_globals = globals().copy()
+ custom_globals[0] = 1
4421
+ print(eval("abv", custom_globals, locals()))
4422
actual = self.get_suggestion(func)
4423
self.assertIn("abc", actual)
4424
0 commit comments