Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0400515

Browse files
committed
Fix the bug Sjoerd Mullender discovered, where find_from_args() wasn't
trying hard enough to find out what the arguments to an import were. There is no test-case for this bug, yet, but this is what it looked like: from encodings import cp1006, cp1026 ImportError: cannot import name cp1026 '__import__' was called with only the first name in the 'arguments' list.
1 parent 84f28db commit 0400515

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Python/ceval.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2864,7 +2864,9 @@ find_from_args(PyFrameObject *f, int nexti)
28642864
} else {
28652865
do {
28662866
oparg = (next_instr[1]<<8) + next_instr[0];
2867-
next_instr += 2;
2867+
/* Jump over our own argument, the next instruction
2868+
(which is a STORE), and its argument.*/
2869+
next_instr += 5;
28682870
name = Getnamev(f, oparg);
28692871
if (PyList_Append(list, name) < 0) {
28702872
Py_DECREF(list);

0 commit comments

Comments
 (0)