]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix the bug Sjoerd Mullender discovered, where find_from_args() wasn't
authorThomas Wouters <thomas@python.org>
Sun, 20 Aug 2000 14:01:53 +0000 (14:01 +0000)
committerThomas Wouters <thomas@python.org>
Sun, 20 Aug 2000 14:01:53 +0000 (14:01 +0000)
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.

Python/ceval.c

index 92fa887af41cf1b91f4c9e38a71eb0dcb38cf33b..9167abee05de99c795b13776c8f96f7dc3caca9a 100644 (file)
@@ -2864,7 +2864,9 @@ find_from_args(PyFrameObject *f, int nexti)
        } else {
                do {
                        oparg = (next_instr[1]<<8) + next_instr[0];
-                       next_instr += 2;
+                       /* Jump over our own argument, the next instruction
+                          (which is a STORE), and its argument.*/
+                       next_instr += 5;
                        name = Getnamev(f, oparg);
                        if (PyList_Append(list, name) < 0) {
                                Py_DECREF(list);