diff options
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 11 | ||||
-rw-r--r-- | Python/errors.c | 3 | ||||
-rw-r--r-- | Python/getcopyright.c | 2 |
3 files changed, 13 insertions, 3 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index f5ebb8e..978ff61 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -738,7 +738,16 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) this wasn't always true before 2.3! PyFrame_New now sets f->f_lasti to -1 (i.e. the index *before* the first instruction) and YIELD_VALUE doesn't fiddle with f_lasti any more. So this - does work. Promise. */ + does work. Promise. + + When the PREDICT() macros are enabled, some opcode pairs follow in + direct succession without updating f->f_lasti. A successful + prediction effectively links the two codes together as if they + were a single new opcode; accordingly,f->f_lasti will point to + the first code in the pair (for instance, GET_ITER followed by + FOR_ITER is effectively a single opcode and f->f_lasti will point + at to the beginning of the combined pair.) + */ next_instr = first_instr + f->f_lasti + 1; stack_pointer = f->f_stacktop; assert(stack_pointer != NULL); diff --git a/Python/errors.c b/Python/errors.c index 28c1ea5..0e565c1 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -649,7 +649,8 @@ PyErr_WarnEx(PyObject *category, const char *message, Py_ssize_t stack_level) if (warnings_module != NULL) { dict = PyModule_GetDict(warnings_module); - func = PyDict_GetItemString(dict, "warn"); + if (dict != NULL) + func = PyDict_GetItemString(dict, "warn"); } if (func == NULL) { PySys_WriteStderr("warning: %s\n", message); diff --git a/Python/getcopyright.c b/Python/getcopyright.c index 325aee5..c10aea4 100644 --- a/Python/getcopyright.c +++ b/Python/getcopyright.c @@ -4,7 +4,7 @@ static char cprt[] = "\ -Copyright (c) 2001-2006 Python Software Foundation.\n\ +Copyright (c) 2001-2007 Python Software Foundation.\n\ All Rights Reserved.\n\ \n\ Copyright (c) 2000 BeOpen.com.\n\ |