Skip to content

gh-101944: correct typo in the comment of PyModule_AddObjectRef #129659

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion Include/modsupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...);
PyAPI_FUNC(PyObject *) Py_VaBuildValue(const char *, va_list);

#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030a0000
// Add an attribute with name 'name' and value 'obj' to the module 'mod.
// Add an attribute with name 'name' and value 'value' to the module 'mod'.
// On success, return 0.
// On error, raise an exception and return -1.
PyAPI_FUNC(int) PyModule_AddObjectRef(PyObject *mod, const char *name, PyObject *value);
Expand Down
2 changes: 1 addition & 1 deletion Python/getopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int _PyOS_GetOpt(Py_ssize_t argc, wchar_t * const *argv, int *longindex)
wchar_t *ptr;
wchar_t option;

if (*opt_ptr == '\0') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated to the issue at hand, so please revert.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always want to make some almost useless modification to the source code when I study the CPython internals. If I submit a PR for every modification, it will waste a lot of time. So I will close this PR. I hope I will make some substantial contribution to CPython in the near future. Thank you for your time !

if (*opt_ptr == L'\0') {

if (_PyOS_optind >= argc)
return -1;
Expand Down
4 changes: 2 additions & 2 deletions Python/initconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -2685,8 +2685,8 @@ config_parse_cmdline(PyConfig *config, PyWideStringList *warnoptions,
return _PyStatus_NO_MEMORY();
}
memcpy(command, _PyOS_optarg, (len - 2) * sizeof(wchar_t));
command[len - 2] = '\n';
command[len - 1] = 0;
command[len - 2] = L'\n';
command[len - 1] = L'\0';
config->run_command = command;
}
break;
Expand Down
Loading