Skip to content

Commit

Permalink
Update define macro
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 committed Nov 25, 2023
1 parent 72d9018 commit ea83973
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
18 changes: 9 additions & 9 deletions Modules/_io/bufferedio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2526,9 +2526,9 @@ static PyMemberDef bufferedreader_members[] = {
};

static PyGetSetDef bufferedreader_getset[] = {
_IO__BUFFERED_CLOSED_GET_GETTERDEF
_IO__BUFFERED_NAME_GET_GETTERDEF
_IO__BUFFERED_MODE_GET_GETTERDEF
_IO__BUFFERED_CLOSED_GETTERDEF
_IO__BUFFERED_NAME_GETTERDEF
_IO__BUFFERED_MODE_GETTERDEF
{NULL}
};

Expand Down Expand Up @@ -2586,9 +2586,9 @@ static PyMemberDef bufferedwriter_members[] = {
};

static PyGetSetDef bufferedwriter_getset[] = {
_IO__BUFFERED_CLOSED_GET_GETTERDEF
_IO__BUFFERED_NAME_GET_GETTERDEF
_IO__BUFFERED_MODE_GET_GETTERDEF
_IO__BUFFERED_CLOSED_GETTERDEF
_IO__BUFFERED_NAME_GETTERDEF
_IO__BUFFERED_MODE_GETTERDEF
{NULL}
};

Expand Down Expand Up @@ -2704,9 +2704,9 @@ static PyMemberDef bufferedrandom_members[] = {
};

static PyGetSetDef bufferedrandom_getset[] = {
_IO__BUFFERED_CLOSED_GET_GETTERDEF
_IO__BUFFERED_NAME_GET_GETTERDEF
_IO__BUFFERED_MODE_GET_GETTERDEF
_IO__BUFFERED_CLOSED_GETTERDEF
_IO__BUFFERED_NAME_GETTERDEF
_IO__BUFFERED_MODE_GETTERDEF
{NULL}
};

Expand Down
8 changes: 4 additions & 4 deletions Modules/_io/clinic/bufferedio.c.h

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

5 changes: 2 additions & 3 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1944,11 +1944,12 @@ def render_function(
full_name = f.full_name
template_dict = {'full_name': full_name}
template_dict['name'] = f.displayname
template_dict['c_basename'] = f.c_basename
if f.getter:
template_dict['methoddef_name'] = f.c_basename.upper() + "_GETTERDEF"
template_dict['c_basename'] = f.c_basename + "_get"
else:
template_dict['methoddef_name'] = f.c_basename.upper() + "_METHODDEF"
template_dict['c_basename'] = f.c_basename

template_dict['docstring'] = self.docstring_for_c_string(f)

Expand Down Expand Up @@ -5533,8 +5534,6 @@ def state_modulename_name(self, line: str) -> None:
line, _, returns = line.partition('->')
returns = returns.strip()
full_name, c_basename = self.parse_function_names(line)
if self.getter:
c_basename += '_get'

return_converter = None
if returns:
Expand Down

0 comments on commit ea83973

Please sign in to comment.