diff options
Diffstat (limited to 'Python/suggestions.c')
-rw-r--r-- | Python/suggestions.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/Python/suggestions.c b/Python/suggestions.c index 43c0ef0..2e76551 100644 --- a/Python/suggestions.c +++ b/Python/suggestions.c @@ -3,7 +3,6 @@ #include "pycore_frame.h" #include "pycore_pyerrors.h" -#include "pycore_code.h" // _PyCode_GetVarnames() #define MAX_CANDIDATE_ITEMS 750 #define MAX_STRING_SIZE 40 @@ -211,12 +210,8 @@ offer_suggestions_for_name_error(PyNameErrorObject *exc) PyFrameObject *frame = traceback->tb_frame; assert(frame != NULL); PyCodeObject *code = PyFrame_GetCode(frame); - assert(code != NULL && code->co_localsplusnames != NULL); - PyObject *varnames = _PyCode_GetVarnames(code); - if (varnames == NULL) { - return NULL; - } - PyObject *dir = PySequence_List(varnames); + assert(code != NULL && code->co_varnames != NULL); + PyObject *dir = PySequence_List(code->co_varnames); Py_DECREF(code); if (dir == NULL) { return NULL; |