Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-101819: Prepare _io._IOBase for module state#104386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall commits
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
3 changes: 3 additions & 0 deletionsModules/_io/_iomodule.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -582,6 +582,7 @@ iomodule_traverse(PyObject *mod, visitproc visit, void *arg) {
return 0;
Py_VISIT(state->unsupported_operation);

Py_VISIT(state->PyIOBase_Type);
Py_VISIT(state->PyIncrementalNewlineDecoder_Type);
Py_VISIT(state->PyRawIOBase_Type);
Py_VISIT(state->PyBufferedIOBase_Type);
Expand DownExpand Up@@ -609,6 +610,7 @@ iomodule_clear(PyObject *mod) {
return 0;
Py_CLEAR(state->unsupported_operation);

Py_CLEAR(state->PyIOBase_Type);
Py_CLEAR(state->PyIncrementalNewlineDecoder_Type);
Py_CLEAR(state->PyRawIOBase_Type);
Py_CLEAR(state->PyBufferedIOBase_Type);
Expand DownExpand Up@@ -751,6 +753,7 @@ PyInit__io(void)
}

// Base classes
state->PyIOBase_Type = (PyTypeObject *)Py_NewRef(&PyIOBase_Type);
ADD_TYPE(m, state->PyIncrementalNewlineDecoder_Type, &nldecoder_spec, NULL);
ADD_TYPE(m, state->PyBytesIOBuffer_Type, &bytesiobuf_spec, NULL);

Expand Down
1 change: 1 addition & 0 deletionsModules/_io/_iomodule.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -149,6 +149,7 @@ struct _io_state {
PyObject *unsupported_operation;

/* Types */
PyTypeObject *PyIOBase_Type;
PyTypeObject *PyIncrementalNewlineDecoder_Type;
PyTypeObject *PyRawIOBase_Type;
PyTypeObject *PyBufferedIOBase_Type;
Expand Down
18 changes: 11 additions & 7 deletionsModules/_io/clinic/iobase.c.h
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

10 changes: 6 additions & 4 deletionsModules/_io/iobase.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -511,15 +511,17 @@ iobase_exit(PyObject *self, PyObject *args)

/*[clinic input]
_io._IOBase.fileno
cls: defining_class
/

Returns underlying file descriptor if one exists.
Return underlying file descriptor if one exists.

OSError is raised if the IO object does not use a file descriptor.
Raise OSError if the IO object does not use a file descriptor.
[clinic start generated code]*/

static PyObject *
_io__IOBase_fileno_impl(PyObject *self)
/*[clinic end generated code: output=7cc0973f0f5f3b73 input=4e37028947dc1cc8]*/
_io__IOBase_fileno_impl(PyObject *self, PyTypeObject *cls)
/*[clinic end generated code: output=7caaa32a6f4ada3d input=1927c8bea5c85099]*/
{
_PyIO_State *state = IO_STATE();
return iobase_unsupported(state, "fileno");
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp