Skip to content
Merged
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
Next Next commit
Add ChannelNotEmptyError.
  • Loading branch information
ericsnowcurrently committed May 17, 2018
commit 8c3e1493174807bb70930ba29f83d0d242fc3093
11 changes: 11 additions & 0 deletions Modules/_xxsubinterpretersmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ static PyObject *ChannelError;
static PyObject *ChannelNotFoundError;
static PyObject *ChannelClosedError;
static PyObject *ChannelEmptyError;
static PyObject *ChannelNotEmptyError;

static int
channel_exceptions_init(PyObject *ns)
Expand Down Expand Up @@ -356,6 +357,16 @@ channel_exceptions_init(PyObject *ns)
return -1;
}

// An operation tried to close a non-empty channel.
ChannelNotEmptyError = PyErr_NewException(
"_xxsubinterpreters.ChannelNotEmptyError", ChannelError, NULL);
if (ChannelNotEmptyError == NULL) {
return -1;
}
if (PyDict_SetItemString(ns, "ChannelNotEmptyError", ChannelNotEmptyError) != 0) {
return -1;
}

return 0;
}

Expand Down