summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-08-02 02:59:08 (GMT)
committerGuido van Rossum <guido@python.org>1997-08-02 02:59:08 (GMT)
commiteb46d67ce5f4906bdae80458080e5e6bfff6512b (patch)
tree7f69f791fd95e76e7200bd38dd3355d101986132 /Objects
parent8cf047647418999fb8cd0e99b005b5fae8f50a3c (diff)
downloadcpython-eb46d67ce5f4906bdae80458080e5e6bfff6512b.zip
cpython-eb46d67ce5f4906bdae80458080e5e6bfff6512b.tar.gz
cpython-eb46d67ce5f4906bdae80458080e5e6bfff6512b.tar.bz2
Avoid function calls to access the current thread state and builtins
-- the thread state is passed in as an argument and the builtins are a member thereof.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/frameobject.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index 4ee1fe5..26f54f8 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -222,13 +222,11 @@ PyFrame_New(tstate, code, globals, locals)
f->f_locals = locals;
f->f_trace = NULL;
f->f_exc_type = f->f_exc_value = f->f_exc_traceback = NULL;
- f->f_tstate = PyThreadState_Get();
- if (f->f_tstate == NULL)
- Py_FatalError("can't create new frame without thread");
+ f->f_tstate = tstate;
f->f_lasti = 0;
f->f_lineno = code->co_firstlineno;
- f->f_restricted = (builtins != PyBuiltin_GetDict());
+ f->f_restricted = (builtins != tstate->interp->builtins);
f->f_iblock = 0;
f->f_nlocals = code->co_nlocals;
f->f_stacksize = extras - code->co_nlocals;