Commit caf2f8e3 authored by Guido van Rossum's avatar Guido van Rossum

Add -v flag. Comment duplicate Py_Finalize().

parent f5957eaf
...@@ -26,6 +26,8 @@ can log in on your machine. Use with caution! ...@@ -26,6 +26,8 @@ can log in on your machine. Use with caution!
#include <Python.h> #include <Python.h>
extern int Py_VerboseFlag;
#ifndef PORT #ifndef PORT
#define PORT 4000 #define PORT 4000
#endif #endif
...@@ -62,8 +64,11 @@ main(int argc, char **argv) ...@@ -62,8 +64,11 @@ main(int argc, char **argv)
if (argc > 0 && argv[0] != NULL && argv[0][0] != '\0') if (argc > 0 && argv[0] != NULL && argv[0][0] != '\0')
progname = argv[0]; progname = argv[0];
while ((c = getopt(argc, argv, "")) != EOF) { while ((c = getopt(argc, argv, "v")) != EOF) {
switch (c) { switch (c) {
case 'v':
Py_VerboseFlag++;
break;
default: default:
usage(); usage();
} }
...@@ -173,7 +178,8 @@ main_thread(int port) ...@@ -173,7 +178,8 @@ main_thread(int port)
PyEval_AcquireThread(gtstate); PyEval_AcquireThread(gtstate);
gtstate = NULL; gtstate = NULL;
Py_Finalize(); Py_Finalize();
Py_Finalize(); /* And a second time, just because we can. */
Py_Finalize(); /* This should be harmless. */
} }
exit(0); exit(0);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment