summaryrefslogtreecommitdiff
path: root/Python/suggestions.c
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2021-06-04 17:51:05 +0100
committerGitHub <noreply@github.com>2021-06-04 17:51:05 +0100
commit17c4edc4e0692fe55e185755ea8a2f5238f3ef08 (patch)
tree563807f4bbdebbf89b2065e4807cc291c44be2b1 /Python/suggestions.c
parenta46c220edc5cf716d0b71eb80ac29ecdb4ebb430 (diff)
downloadcpython-git-17c4edc4e0692fe55e185755ea8a2f5238f3ef08.tar.gz
bpo-43693: Revert commits 2c1e2583fdc4db6b43d163239ea42b0e8394171f and b2bf2bc1ece673d387341e06c8d3c2bc6e259747 (GH-26530)
* Revert "bpo-43693: Compute deref offsets in compiler (gh-25152)" This reverts commit b2bf2bc1ece673d387341e06c8d3c2bc6e259747. * Revert "bpo-43693: Add new internal code objects fields: co_fastlocalnames and co_fastlocalkinds. (gh-26388)" This reverts commit 2c1e2583fdc4db6b43d163239ea42b0e8394171f. These two commits are breaking the refleak buildbots.
Diffstat (limited to 'Python/suggestions.c')
-rw-r--r--Python/suggestions.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/Python/suggestions.c b/Python/suggestions.c
index 43c0ef09cb..2e76551f36 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;