Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f488af3

Browse files
committed
Parse new command line option -X which enables exception classes.
1 parent 0596c2a commit f488af3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Modules/main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ Options and arguments (and corresponding environment variables):\n\
6363
and force prompts, even if stdin does not appear to be a terminal.\n\
6464
-O : optimize generated bytecode (a tad).\n\
6565
-u : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x)\n\
66+
-X : use experimental class based exceptions\n\
6667
-v : verbose (trace import statements) (also PYTHONVERBOSE=x)\n\
6768
";
6869
static char *usage_bot = "\
@@ -105,7 +106,7 @@ Py_Main(argc, argv)
105106
if ((p = getenv("PYTHONUNBUFFERED")) && *p != '\0')
106107
unbuffered = 1;
107108

108-
while ((c = getopt(argc, argv, "c:diOuv")) != EOF) {
109+
while ((c = getopt(argc, argv, "c:diOuvX")) != EOF) {
109110
if (c == 'c') {
110111
/* -c is the last option; following arguments
111112
that look like options are left for the
@@ -142,6 +143,10 @@ Py_Main(argc, argv)
142143
Py_VerboseFlag++;
143144
break;
144145

146+
case 'X':
147+
Py_UseClassExceptionsFlag++;
148+
break;
149+
145150
/* This space reserved for other options */
146151

147152
default:

0 commit comments

Comments
 (0)