mirror of
https://github.com/python/cpython.git
synced 2025-07-17 08:15:19 +00:00
#16306: merge with 3.3.
This commit is contained in:
commit
195ad6ce05
4 changed files with 17 additions and 6 deletions
|
@ -45,7 +45,7 @@ static wchar_t *opt_ptr = L"";
|
|||
|
||||
void _PyOS_ResetGetOpt(void)
|
||||
{
|
||||
_PyOS_opterr = 1;
|
||||
_PyOS_opterr = 0; /* prevent printing the error in 2nd loop in main.c */
|
||||
_PyOS_optind = 1;
|
||||
_PyOS_optarg = NULL;
|
||||
opt_ptr = L"";
|
||||
|
@ -90,18 +90,18 @@ int _PyOS_GetOpt(int argc, wchar_t **argv, wchar_t *optstring)
|
|||
opt_ptr = &argv[_PyOS_optind++][1];
|
||||
}
|
||||
|
||||
if ( (option = *opt_ptr++) == L'\0')
|
||||
if ((option = *opt_ptr++) == L'\0')
|
||||
return -1;
|
||||
|
||||
if (option == 'J') {
|
||||
fprintf(stderr, "-J is reserved for Jython\n");
|
||||
if (_PyOS_opterr)
|
||||
fprintf(stderr, "-J is reserved for Jython\n");
|
||||
return '_';
|
||||
}
|
||||
|
||||
if ((ptr = wcschr(optstring, option)) == NULL) {
|
||||
if (_PyOS_opterr)
|
||||
fprintf(stderr, "Unknown option: -%c\n", (char)option);
|
||||
|
||||
fprintf(stderr, "Unknown option: -%c\n", (char)option);
|
||||
return '_';
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue