summaryrefslogtreecommitdiffstats
path: root/Demo
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-10-05 22:16:07 (GMT)
committerGuido van Rossum <guido@python.org>1999-10-05 22:16:07 (GMT)
commitcaf2f8e3c71cad510852939d425581acbff6317b (patch)
tree55f3e16961a605b89d3c048b8e4068e7043234ab /Demo
parentf5957eaf0af0decd72ec28985bd2e18c125249b2 (diff)
downloadcpython-caf2f8e3c71cad510852939d425581acbff6317b.zip
cpython-caf2f8e3c71cad510852939d425581acbff6317b.tar.gz
cpython-caf2f8e3c71cad510852939d425581acbff6317b.tar.bz2
Add -v flag. Comment duplicate Py_Finalize().
Diffstat (limited to 'Demo')
-rw-r--r--Demo/pysvr/pysvr.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Demo/pysvr/pysvr.c b/Demo/pysvr/pysvr.c
index e41d88e..995a7ca 100644
--- a/Demo/pysvr/pysvr.c
+++ b/Demo/pysvr/pysvr.c
@@ -26,6 +26,8 @@ can log in on your machine. Use with caution!
#include <Python.h>
+extern int Py_VerboseFlag;
+
#ifndef PORT
#define PORT 4000
#endif
@@ -62,8 +64,11 @@ main(int argc, char **argv)
if (argc > 0 && argv[0] != NULL && argv[0][0] != '\0')
progname = argv[0];
- while ((c = getopt(argc, argv, "")) != EOF) {
+ while ((c = getopt(argc, argv, "v")) != EOF) {
switch (c) {
+ case 'v':
+ Py_VerboseFlag++;
+ break;
default:
usage();
}
@@ -173,7 +178,8 @@ main_thread(int port)
PyEval_AcquireThread(gtstate);
gtstate = NULL;
Py_Finalize();
- Py_Finalize();
+ /* And a second time, just because we can. */
+ Py_Finalize(); /* This should be harmless. */
}
exit(0);
}