]> granicus.if.org Git - python/commitdiff
Add -v flag. Comment duplicate Py_Finalize().
authorGuido van Rossum <guido@python.org>
Tue, 5 Oct 1999 22:16:07 +0000 (22:16 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 5 Oct 1999 22:16:07 +0000 (22:16 +0000)
Demo/pysvr/pysvr.c

index e41d88e1ae1c84fe184314a67bcdb13740d39607..995a7ca0d14c0cf29ff920fa3c021d1d2c3d5c13 100644 (file)
@@ -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);
 }