| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent dfc5596 commit 31f0d6e
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4232,8 +4232,8 @@ def make_module(self, code): | |||
| 4232 | 4232 | ||
| 4233 | 4233 | return mod_name | |
| 4234 | 4234 | ||
| 4235 | - def get_import_from_suggestion(self, mod_dict, name): | ||
| 4236 | - modname = self.make_module(mod_dict) | ||
| 4235 | + def get_import_from_suggestion(self, code, name): | ||
| 4236 | + modname = self.make_module(code) | ||
| 4237 | 4237 | ||
| 4238 | 4238 | def callable(): | |
| 4239 | 4239 | try: | |
@@ -4416,8 +4416,9 @@ def func(): | |||
| 4416 | 4416 | def test_name_error_suggestions_with_non_string_candidates(self): | |
| 4417 | 4417 | def func(): | |
| 4418 | 4418 | abc = 1 | |
| 4419 | - globals()[0] = 1 | ||
| 4420 | - abv | ||
| 4419 | + custom_globals = globals().copy() | ||
| 4420 | + custom_globals[0] = 1 | ||
| 4421 | + print(eval("abv", custom_globals, locals())) | ||
| 4421 | 4422 | actual = self.get_suggestion(func) | |
| 4422 | 4423 | self.assertIn("abc", actual) | |
| 4423 | 4424 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments