mirror of
https://github.com/python/cpython.git
synced 2024-11-25 10:54:51 +08:00
Swap the sense of the -X option vis-a-vis Py_UseClassExceptionsFlag so
that class based exceptions are enabled by default. -X disables them in favor of the old-style string exceptions.
This commit is contained in:
parent
757af0e7bb
commit
83b6709d8e
@ -63,7 +63,7 @@ Options and arguments (and corresponding environment variables):\n\
|
|||||||
and force prompts, even if stdin does not appear to be a terminal.\n\
|
and force prompts, even if stdin does not appear to be a terminal.\n\
|
||||||
-O : optimize generated bytecode (a tad).\n\
|
-O : optimize generated bytecode (a tad).\n\
|
||||||
-u : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x)\n\
|
-u : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x)\n\
|
||||||
-X : use experimental class based exceptions\n\
|
-X : disable class based built-in exceptions\n\
|
||||||
-v : verbose (trace import statements) (also PYTHONVERBOSE=x)\n\
|
-v : verbose (trace import statements) (also PYTHONVERBOSE=x)\n\
|
||||||
";
|
";
|
||||||
static char *usage_bot = "\
|
static char *usage_bot = "\
|
||||||
@ -106,6 +106,7 @@ Py_Main(argc, argv)
|
|||||||
if ((p = getenv("PYTHONUNBUFFERED")) && *p != '\0')
|
if ((p = getenv("PYTHONUNBUFFERED")) && *p != '\0')
|
||||||
unbuffered = 1;
|
unbuffered = 1;
|
||||||
|
|
||||||
|
Py_UseClassExceptionsFlag = 1;
|
||||||
while ((c = getopt(argc, argv, "c:diOuvX")) != EOF) {
|
while ((c = getopt(argc, argv, "c:diOuvX")) != EOF) {
|
||||||
if (c == 'c') {
|
if (c == 'c') {
|
||||||
/* -c is the last option; following arguments
|
/* -c is the last option; following arguments
|
||||||
@ -144,7 +145,7 @@ Py_Main(argc, argv)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'X':
|
case 'X':
|
||||||
Py_UseClassExceptionsFlag++;
|
Py_UseClassExceptionsFlag = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* This space reserved for other options */
|
/* This space reserved for other options */
|
||||||
|
Loading…
Reference in New Issue
Block a user