Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 1 | /*********************************************************** |
Guido van Rossum | fd71b9e | 2000-06-30 23:50:40 +0000 | [diff] [blame] | 2 | Copyright (c) 2000, BeOpen.com. |
| 3 | Copyright (c) 1995-2000, Corporation for National Research Initiatives. |
| 4 | Copyright (c) 1990-1995, Stichting Mathematisch Centrum. |
| 5 | All rights reserved. |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 6 | |
Guido van Rossum | fd71b9e | 2000-06-30 23:50:40 +0000 | [diff] [blame] | 7 | See the file "Misc/COPYRIGHT" for information on usage and |
| 8 | redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 9 | ******************************************************************/ |
| 10 | |
| 11 | /* Python interpreter main program */ |
| 12 | |
| 13 | #include "Python.h" |
Guido van Rossum | a075ce1 | 1997-12-05 21:56:45 +0000 | [diff] [blame] | 14 | #include "osdefs.h" |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 15 | |
Guido van Rossum | 66a7013 | 1996-12-09 18:46:58 +0000 | [diff] [blame] | 16 | #ifdef HAVE_UNISTD_H |
| 17 | #include <unistd.h> |
| 18 | #endif |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 19 | |
Guido van Rossum | 3e7ae7a | 1997-01-17 22:05:38 +0000 | [diff] [blame] | 20 | #ifdef MS_WINDOWS |
| 21 | #include <fcntl.h> |
| 22 | #endif |
| 23 | |
Guido van Rossum | a075ce1 | 1997-12-05 21:56:45 +0000 | [diff] [blame] | 24 | #if defined(PYOS_OS2) || defined(MS_WINDOWS) |
| 25 | #define PYTHONHOMEHELP "<prefix>\\lib" |
| 26 | #else |
Fredrik Lundh | 620f377 | 2000-07-09 20:42:34 +0000 | [diff] [blame] | 27 | #define PYTHONHOMEHELP "<prefix>/python2.0" |
Guido van Rossum | a075ce1 | 1997-12-05 21:56:45 +0000 | [diff] [blame] | 28 | #endif |
| 29 | |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 30 | /* Interface to getopt(): */ |
| 31 | extern int optind; |
| 32 | extern char *optarg; |
| 33 | extern int getopt(); /* PROTO((int, char **, char *)); -- not standardized */ |
| 34 | |
| 35 | |
Guido van Rossum | ac56b03 | 1996-07-21 02:33:38 +0000 | [diff] [blame] | 36 | /* For Py_GetArgcArgv(); set by main() */ |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 37 | static char **orig_argv; |
| 38 | static int orig_argc; |
| 39 | |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 40 | /* Short usage message (with %s for argv0) */ |
| 41 | static char *usage_line = |
Guido van Rossum | 6b86a42 | 1999-01-28 15:07:47 +0000 | [diff] [blame] | 42 | "usage: %s [option] ... [-c cmd | file | -] [arg] ...\n"; |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 43 | |
| 44 | /* Long usage message, split into parts < 512 bytes */ |
Guido van Rossum | a075ce1 | 1997-12-05 21:56:45 +0000 | [diff] [blame] | 45 | static char *usage_top = "\ |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 46 | Options and arguments (and corresponding environment variables):\n\ |
| 47 | -d : debug output from parser (also PYTHONDEBUG=x)\n\ |
Guido van Rossum | 775af91 | 1997-02-14 19:50:32 +0000 | [diff] [blame] | 48 | -i : inspect interactively after running script, (also PYTHONINSPECT=x)\n\ |
Guido van Rossum | bba92ca | 1998-04-10 19:39:15 +0000 | [diff] [blame] | 49 | and force prompts, even if stdin does not appear to be a terminal\n\ |
Guido van Rossum | e7adf3e | 1998-10-07 14:50:06 +0000 | [diff] [blame] | 50 | -O : optimize generated bytecode (a tad; also PYTHONOPTIMIZE=x)\n\ |
Guido van Rossum | 6b86a42 | 1999-01-28 15:07:47 +0000 | [diff] [blame] | 51 | -OO : remove doc-strings in addition to the -O optimizations\n\ |
Guido van Rossum | 7922bd7 | 1997-08-29 22:34:47 +0000 | [diff] [blame] | 52 | -S : don't imply 'import site' on initialization\n\ |
Guido van Rossum | bba92ca | 1998-04-10 19:39:15 +0000 | [diff] [blame] | 53 | -t : issue warnings about inconsistent tab usage (-tt: issue errors)\n\ |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 54 | "; |
Guido van Rossum | 7922bd7 | 1997-08-29 22:34:47 +0000 | [diff] [blame] | 55 | static char *usage_mid = "\ |
Guido van Rossum | bba92ca | 1998-04-10 19:39:15 +0000 | [diff] [blame] | 56 | -u : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x)\n\ |
Guido van Rossum | c15a9a1 | 2000-05-01 17:54:33 +0000 | [diff] [blame] | 57 | -U : Unicode literals: treats '...' literals like u'...'\n\ |
Guido van Rossum | 7922bd7 | 1997-08-29 22:34:47 +0000 | [diff] [blame] | 58 | -v : verbose (trace import statements) (also PYTHONVERBOSE=x)\n\ |
Guido van Rossum | a075ce1 | 1997-12-05 21:56:45 +0000 | [diff] [blame] | 59 | -x : skip first line of source, allowing use of non-Unix forms of #!cmd\n\ |
Guido van Rossum | 775af91 | 1997-02-14 19:50:32 +0000 | [diff] [blame] | 60 | -c cmd : program passed in as string (terminates option list)\n\ |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 61 | file : program read from script file\n\ |
| 62 | - : program read from stdin (default; interactive mode if a tty)\n\ |
Guido van Rossum | 7922bd7 | 1997-08-29 22:34:47 +0000 | [diff] [blame] | 63 | "; |
| 64 | static char *usage_bot = "\ |
Guido van Rossum | bba92ca | 1998-04-10 19:39:15 +0000 | [diff] [blame] | 65 | arg ...: arguments passed to program in sys.argv[1:]\n\ |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 66 | Other environment variables:\n\ |
| 67 | PYTHONSTARTUP: file executed on interactive startup (no default)\n\ |
Guido van Rossum | a075ce1 | 1997-12-05 21:56:45 +0000 | [diff] [blame] | 68 | PYTHONPATH : '%c'-separated list of directories prefixed to the\n\ |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 69 | default module search path. The result is sys.path.\n\ |
Guido van Rossum | a075ce1 | 1997-12-05 21:56:45 +0000 | [diff] [blame] | 70 | PYTHONHOME : alternate <prefix> directory (or <prefix>%c<exec_prefix>).\n\ |
| 71 | The default module search path uses %s.\n\ |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 72 | "; |
| 73 | |
| 74 | |
| 75 | /* Main program */ |
| 76 | |
Guido van Rossum | 9c1201f | 1998-12-07 14:28:47 +0000 | [diff] [blame] | 77 | DL_EXPORT(int) |
Fredrik Lundh | 620f377 | 2000-07-09 20:42:34 +0000 | [diff] [blame] | 78 | Py_Main(int argc, char **argv) |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 79 | { |
| 80 | int c; |
| 81 | int sts; |
| 82 | char *command = NULL; |
| 83 | char *filename = NULL; |
| 84 | FILE *fp = stdin; |
| 85 | char *p; |
| 86 | int inspect = 0; |
| 87 | int unbuffered = 0; |
Guido van Rossum | a075ce1 | 1997-12-05 21:56:45 +0000 | [diff] [blame] | 88 | int skipfirstline = 0; |
Guido van Rossum | 775af91 | 1997-02-14 19:50:32 +0000 | [diff] [blame] | 89 | int stdin_is_interactive = 0; |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 90 | |
Guido van Rossum | ac56b03 | 1996-07-21 02:33:38 +0000 | [diff] [blame] | 91 | orig_argc = argc; /* For Py_GetArgcArgv() */ |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 92 | orig_argv = argv; |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 93 | |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 94 | if ((p = getenv("PYTHONINSPECT")) && *p != '\0') |
| 95 | inspect = 1; |
| 96 | if ((p = getenv("PYTHONUNBUFFERED")) && *p != '\0') |
| 97 | unbuffered = 1; |
| 98 | |
Guido van Rossum | c15a9a1 | 2000-05-01 17:54:33 +0000 | [diff] [blame] | 99 | while ((c = getopt(argc, argv, "c:diOStuUvxX")) != EOF) { |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 100 | if (c == 'c') { |
| 101 | /* -c is the last option; following arguments |
| 102 | that look like options are left for the |
| 103 | the command to interpret. */ |
| 104 | command = malloc(strlen(optarg) + 2); |
| 105 | if (command == NULL) |
| 106 | Py_FatalError( |
| 107 | "not enough memory to copy -c argument"); |
| 108 | strcpy(command, optarg); |
| 109 | strcat(command, "\n"); |
| 110 | break; |
| 111 | } |
| 112 | |
| 113 | switch (c) { |
| 114 | |
| 115 | case 'd': |
| 116 | Py_DebugFlag++; |
| 117 | break; |
| 118 | |
| 119 | case 'i': |
| 120 | inspect++; |
Guido van Rossum | 775af91 | 1997-02-14 19:50:32 +0000 | [diff] [blame] | 121 | Py_InteractiveFlag++; |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 122 | break; |
| 123 | |
Guido van Rossum | 7614da6 | 1997-03-03 19:14:45 +0000 | [diff] [blame] | 124 | case 'O': |
| 125 | Py_OptimizeFlag++; |
| 126 | break; |
| 127 | |
Guido van Rossum | 7922bd7 | 1997-08-29 22:34:47 +0000 | [diff] [blame] | 128 | case 'S': |
| 129 | Py_NoSiteFlag++; |
| 130 | break; |
| 131 | |
Guido van Rossum | bba92ca | 1998-04-10 19:39:15 +0000 | [diff] [blame] | 132 | case 't': |
| 133 | Py_TabcheckFlag++; |
| 134 | break; |
| 135 | |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 136 | case 'u': |
| 137 | unbuffered++; |
| 138 | break; |
| 139 | |
| 140 | case 'v': |
| 141 | Py_VerboseFlag++; |
| 142 | break; |
| 143 | |
Guido van Rossum | a075ce1 | 1997-12-05 21:56:45 +0000 | [diff] [blame] | 144 | case 'x': |
| 145 | skipfirstline = 1; |
| 146 | break; |
| 147 | |
Guido van Rossum | c15a9a1 | 2000-05-01 17:54:33 +0000 | [diff] [blame] | 148 | case 'U': |
| 149 | Py_UnicodeFlag++; |
| 150 | break; |
| 151 | |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 152 | /* This space reserved for other options */ |
| 153 | |
| 154 | default: |
| 155 | fprintf(stderr, usage_line, argv[0]); |
| 156 | fprintf(stderr, usage_top); |
Guido van Rossum | 7922bd7 | 1997-08-29 22:34:47 +0000 | [diff] [blame] | 157 | fprintf(stderr, usage_mid); |
Guido van Rossum | a075ce1 | 1997-12-05 21:56:45 +0000 | [diff] [blame] | 158 | fprintf(stderr, usage_bot, |
| 159 | DELIM, DELIM, PYTHONHOMEHELP); |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 160 | exit(2); |
| 161 | /*NOTREACHED*/ |
| 162 | |
| 163 | } |
| 164 | } |
| 165 | |
Guido van Rossum | 775af91 | 1997-02-14 19:50:32 +0000 | [diff] [blame] | 166 | if (command == NULL && optind < argc && |
| 167 | strcmp(argv[optind], "-") != 0) |
| 168 | { |
| 169 | filename = argv[optind]; |
| 170 | if (filename != NULL) { |
| 171 | if ((fp = fopen(filename, "r")) == NULL) { |
| 172 | fprintf(stderr, "%s: can't open file '%s'\n", |
| 173 | argv[0], filename); |
| 174 | exit(2); |
| 175 | } |
Guido van Rossum | a075ce1 | 1997-12-05 21:56:45 +0000 | [diff] [blame] | 176 | else if (skipfirstline) { |
Guido van Rossum | dc8b569 | 1999-04-19 17:54:19 +0000 | [diff] [blame] | 177 | int ch; |
| 178 | /* Push back first newline so line numbers |
| 179 | remain the same */ |
| 180 | while ((ch = getc(fp)) != EOF) { |
| 181 | if (ch == '\n') { |
| 182 | (void)ungetc(ch, fp); |
| 183 | break; |
| 184 | } |
| 185 | } |
Guido van Rossum | a075ce1 | 1997-12-05 21:56:45 +0000 | [diff] [blame] | 186 | } |
Guido van Rossum | 775af91 | 1997-02-14 19:50:32 +0000 | [diff] [blame] | 187 | } |
| 188 | } |
| 189 | |
| 190 | stdin_is_interactive = Py_FdIsInteractive(stdin, (char *)0); |
| 191 | |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 192 | if (unbuffered) { |
Guido van Rossum | f22d7e2 | 1997-01-11 19:28:55 +0000 | [diff] [blame] | 193 | #ifdef MS_WINDOWS |
Guido van Rossum | 3e7ae7a | 1997-01-17 22:05:38 +0000 | [diff] [blame] | 194 | _setmode(fileno(stdin), O_BINARY); |
| 195 | _setmode(fileno(stdout), O_BINARY); |
Guido van Rossum | f22d7e2 | 1997-01-11 19:28:55 +0000 | [diff] [blame] | 196 | #endif |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 197 | #ifndef MPW |
Guido van Rossum | 22ffac1 | 1998-03-06 15:30:39 +0000 | [diff] [blame] | 198 | #ifdef HAVE_SETVBUF |
Guido van Rossum | 775af91 | 1997-02-14 19:50:32 +0000 | [diff] [blame] | 199 | setvbuf(stdin, (char *)NULL, _IONBF, BUFSIZ); |
| 200 | setvbuf(stdout, (char *)NULL, _IONBF, BUFSIZ); |
| 201 | setvbuf(stderr, (char *)NULL, _IONBF, BUFSIZ); |
Guido van Rossum | 22ffac1 | 1998-03-06 15:30:39 +0000 | [diff] [blame] | 202 | #else /* !HAVE_SETVBUF */ |
| 203 | setbuf(stdin, (char *)NULL); |
| 204 | setbuf(stdout, (char *)NULL); |
| 205 | setbuf(stderr, (char *)NULL); |
| 206 | #endif /* !HAVE_SETVBUF */ |
| 207 | #else /* MPW */ |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 208 | /* On MPW (3.2) unbuffered seems to hang */ |
Guido van Rossum | 775af91 | 1997-02-14 19:50:32 +0000 | [diff] [blame] | 209 | setvbuf(stdin, (char *)NULL, _IOLBF, BUFSIZ); |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 210 | setvbuf(stdout, (char *)NULL, _IOLBF, BUFSIZ); |
| 211 | setvbuf(stderr, (char *)NULL, _IOLBF, BUFSIZ); |
Guido van Rossum | 22ffac1 | 1998-03-06 15:30:39 +0000 | [diff] [blame] | 212 | #endif /* MPW */ |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 213 | } |
Guido van Rossum | 2a21219 | 1997-04-11 21:57:53 +0000 | [diff] [blame] | 214 | else if (Py_InteractiveFlag) { |
Guido van Rossum | b31c7dc | 1997-04-11 22:19:12 +0000 | [diff] [blame] | 215 | #ifdef MS_WINDOWS |
| 216 | /* Doesn't have to have line-buffered -- use unbuffered */ |
Guido van Rossum | 01b7ced | 1999-02-09 18:36:51 +0000 | [diff] [blame] | 217 | /* Any set[v]buf(stdin, ...) screws up Tkinter :-( */ |
Guido van Rossum | b31c7dc | 1997-04-11 22:19:12 +0000 | [diff] [blame] | 218 | setvbuf(stdout, (char *)NULL, _IONBF, BUFSIZ); |
Guido van Rossum | 22ffac1 | 1998-03-06 15:30:39 +0000 | [diff] [blame] | 219 | #else /* !MS_WINDOWS */ |
| 220 | #ifdef HAVE_SETVBUF |
Guido van Rossum | b31c7dc | 1997-04-11 22:19:12 +0000 | [diff] [blame] | 221 | setvbuf(stdin, (char *)NULL, _IOLBF, BUFSIZ); |
| 222 | setvbuf(stdout, (char *)NULL, _IOLBF, BUFSIZ); |
Guido van Rossum | 22ffac1 | 1998-03-06 15:30:39 +0000 | [diff] [blame] | 223 | #endif /* HAVE_SETVBUF */ |
| 224 | #endif /* !MS_WINDOWS */ |
Guido van Rossum | 775af91 | 1997-02-14 19:50:32 +0000 | [diff] [blame] | 225 | /* Leave stderr alone - it should be unbuffered anyway. */ |
| 226 | } |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 227 | |
Guido van Rossum | ed52aac | 1997-07-19 19:20:32 +0000 | [diff] [blame] | 228 | Py_SetProgramName(argv[0]); |
| 229 | Py_Initialize(); |
| 230 | |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 231 | if (Py_VerboseFlag || |
Guido van Rossum | 129e91a | 1997-02-14 21:00:50 +0000 | [diff] [blame] | 232 | (command == NULL && filename == NULL && stdin_is_interactive)) |
Guido van Rossum | fe4dfc7 | 1997-05-19 18:33:01 +0000 | [diff] [blame] | 233 | fprintf(stderr, "Python %s on %s\n%s\n", |
| 234 | Py_GetVersion(), Py_GetPlatform(), Py_GetCopyright()); |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 235 | |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 236 | |
| 237 | if (command != NULL) { |
| 238 | /* Backup optind and force sys.argv[0] = '-c' */ |
| 239 | optind--; |
| 240 | argv[optind] = "-c"; |
| 241 | } |
| 242 | |
| 243 | PySys_SetArgv(argc-optind, argv+optind); |
| 244 | |
Guido van Rossum | 3d26cc9 | 1997-09-16 16:11:28 +0000 | [diff] [blame] | 245 | if ((inspect || (command == NULL && filename == NULL)) && |
| 246 | isatty(fileno(stdin))) { |
| 247 | PyObject *v; |
| 248 | v = PyImport_ImportModule("readline"); |
| 249 | if (v == NULL) |
| 250 | PyErr_Clear(); |
| 251 | else |
| 252 | Py_DECREF(v); |
| 253 | } |
| 254 | |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 255 | if (command) { |
| 256 | sts = PyRun_SimpleString(command) != 0; |
Guido van Rossum | 05f7c50 | 1997-08-02 03:00:42 +0000 | [diff] [blame] | 257 | free(command); |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 258 | } |
| 259 | else { |
Guido van Rossum | 775af91 | 1997-02-14 19:50:32 +0000 | [diff] [blame] | 260 | if (filename == NULL && stdin_is_interactive) { |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 261 | char *startup = getenv("PYTHONSTARTUP"); |
| 262 | if (startup != NULL && startup[0] != '\0') { |
| 263 | FILE *fp = fopen(startup, "r"); |
| 264 | if (fp != NULL) { |
| 265 | (void) PyRun_SimpleFile(fp, startup); |
| 266 | PyErr_Clear(); |
| 267 | fclose(fp); |
| 268 | } |
| 269 | } |
| 270 | } |
Guido van Rossum | 0df002c | 2000-08-27 19:21:52 +0000 | [diff] [blame] | 271 | sts = PyRun_AnyFileEx( |
Guido van Rossum | 775af91 | 1997-02-14 19:50:32 +0000 | [diff] [blame] | 272 | fp, |
Guido van Rossum | 0df002c | 2000-08-27 19:21:52 +0000 | [diff] [blame] | 273 | filename == NULL ? "<stdin>" : filename, |
| 274 | filename != NULL) != 0; |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 275 | } |
| 276 | |
Guido van Rossum | 775af91 | 1997-02-14 19:50:32 +0000 | [diff] [blame] | 277 | if (inspect && stdin_is_interactive && |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 278 | (filename != NULL || command != NULL)) |
| 279 | sts = PyRun_AnyFile(stdin, "<stdin>") != 0; |
| 280 | |
Guido van Rossum | 5d1770e | 1997-08-05 02:23:48 +0000 | [diff] [blame] | 281 | Py_Finalize(); |
Guido van Rossum | 05f7c50 | 1997-08-02 03:00:42 +0000 | [diff] [blame] | 282 | return sts; |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 286 | /* Make the *original* argc/argv available to other modules. |
| 287 | This is rare, but it is needed by the secureware extension. */ |
| 288 | |
| 289 | void |
Fredrik Lundh | 620f377 | 2000-07-09 20:42:34 +0000 | [diff] [blame] | 290 | Py_GetArgcArgv(int *argc, char ***argv) |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 291 | { |
| 292 | *argc = orig_argc; |
| 293 | *argv = orig_argv; |
| 294 | } |