Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Drop xoptions from PyInterpreterState.
  • Loading branch information
ericsnowcurrently committed Sep 11, 2017
commit 1c951caedf44af489a1274903724f7125b4271f1
1 change: 0 additions & 1 deletion Include/pystate.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ typedef struct _is {

/* Used in Python/sysmodule.c. */
int check_interval;
PyObject *xoptions;

/* Used in Modules/_threadmodule.c. */
long num_threads;
Expand Down
1 change: 0 additions & 1 deletion Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ PyInterpreterState_New(void)
interp->builtins_copy = NULL;
interp->tstate_head = NULL;
interp->check_interval = 100;
interp->xoptions = NULL;
interp->num_threads = 0;
interp->pythread_stacksize = 0;
interp->codec_search_path = NULL;
Expand Down
8 changes: 6 additions & 2 deletions Python/sysmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ extern const char *PyWin_DLLVersionString;

_Py_IDENTIFIER(_);
_Py_IDENTIFIER(__sizeof__);
_Py_IDENTIFIER(_xoptions);
_Py_IDENTIFIER(buffer);
_Py_IDENTIFIER(builtins);
_Py_IDENTIFIER(encoding);
Expand Down Expand Up @@ -1533,13 +1534,16 @@ PySys_HasWarnOptions(void)
static PyObject *
get_xoptions(void)
{
PyObject *xoptions = PyThreadState_GET()->interp->xoptions;
PyObject *xoptions = _PySys_GetObjectId(&PyId__xoptions);
if (xoptions == NULL || !PyDict_Check(xoptions)) {
Py_XDECREF(xoptions);
xoptions = PyDict_New();
if (xoptions == NULL)
return NULL;
PyThreadState_GET()->interp->xoptions = xoptions;
if (_PySys_SetObjectId(&PyId__xoptions, xoptions)) {
Py_DECREF(xoptions);
return NULL;
}
}
return xoptions;
}
Expand Down