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 3d9658a commit 3e18a3cCopy full SHA for 3e18a3c
Lib/test/test_traceback.py
@@ -4271,8 +4271,8 @@ def make_module(self, code):
4271
4272
return mod_name
4273
4274
- def get_import_from_suggestion(self, mod_dict, name):
4275
- modname = self.make_module(mod_dict)
+ def get_import_from_suggestion(self, code, name):
+ modname = self.make_module(code)
4276
4277
def callable():
4278
try:
@@ -4455,8 +4455,9 @@ def func():
4455
def test_name_error_suggestions_with_non_string_candidates(self):
4456
def func():
4457
abc = 1
4458
- globals()[0] = 1
4459
- abv
+ custom_globals = globals().copy()
+ custom_globals[0] = 1
4460
+ print(eval("abv", custom_globals, locals()))
4461
actual = self.get_suggestion(func)
4462
self.assertIn("abc", actual)
4463
0 commit comments