]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Avoid function calls to access the current thread state and builtins
authorGuido van Rossum <guido@python.org>
Sat, 2 Aug 1997 02:59:08 +0000 (02:59 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 2 Aug 1997 02:59:08 +0000 (02:59 +0000)
-- the thread state is passed in as an argument and the builtins are a
member thereof.

Objects/frameobject.c

index 4ee1fe5fd3f60952112997dbb86ae211ca1501a4..26f54f86f8edfce5f7e7aa9a2ef8d1470aba250b 100644 (file)
@@ -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;