Skip to content

Commit

Permalink
EG: fix bug SEGV during GC
Browse files Browse the repository at this point in the history
  • Loading branch information
ejgroene committed Nov 12, 2021
1 parent ee66779 commit 18d8bc5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions weightless/core/__init__.py
Expand Up @@ -29,8 +29,8 @@
from types import GeneratorType, FunctionType

from os.path import dirname, abspath, isdir, join #DO_NOT_DISTRIBUTE
from sys import version_info #DO_NOT_DISTRIBUTE
pycmd = "python%s.%s" % version_info[:2] #DO_NOT_DISTRIBUTE
from sys import executable #DO_NOT_DISTRIBUTE
pycmd = executable #DO_NOT_DISTRIBUTE
_mydir = abspath(dirname(__file__)) #DO_NOT_DISTRIBUTE
_projectdir = dirname(dirname(_mydir)) #DO_NOT_DISTRIBUTE
if isdir(join(_mydir, '.svn')) or isdir(join(_projectdir, '.git')): #DO_NOT_DISTRIBUTE
Expand Down
2 changes: 1 addition & 1 deletion weightless/core/_compose.c
Expand Up @@ -475,7 +475,7 @@ static PyObject* _compose_go_with_frame(PyComposeObject* self, PyObject* exc_typ
PyThreadState* tstate = PyThreadState_GET();
PyFrameObject* tstate_frame = tstate->frame;
self->frame->f_back = tstate_frame;
Py_INCREF(self->frame->f_back);
Py_XINCREF(self->frame->f_back); /* can be NULL during GC */
tstate->frame = self->frame;
*(self->frame->f_stacktop++) = (PyObject*) self;
Py_INCREF(self);
Expand Down

0 comments on commit 18d8bc5

Please sign in to comment.