Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 2318:99e7ac22bd2e legacy-trunk
mac changes:
- Assume files of types 'PYC ' and 'APPL' are compiled python code
- For mwerks, show status line when program has terminated while
keeping window open.
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Mon, 13 Feb 1995 11:44:56 +0000 |
| parents | a24146241991 |
| children | 16ea57c38c4f |
comparison
equal
deleted
inserted
replaced
| 2317:1ce07f64862e | 2318:99e7ac22bd2e |
|---|---|
| 228 m = add_module("__main__"); | 228 m = add_module("__main__"); |
| 229 if (m == NULL) | 229 if (m == NULL) |
| 230 return -1; | 230 return -1; |
| 231 d = getmoduledict(m); | 231 d = getmoduledict(m); |
| 232 ext = filename + strlen(filename) - 4; | 232 ext = filename + strlen(filename) - 4; |
| 233 #ifdef macintosh | |
| 234 /* On a mac, we also assume a pyc file for types 'PYC ' and 'APPL' */ | |
| 235 if ( strcmp(ext, ".pyc") == 0 || getfiletype(filename) == 'PYC ' || | |
| 236 getfiletype(filename) == 'APPL' ) { | |
| 237 #else | |
| 233 if ( strcmp(ext, ".pyc") == 0 ) { | 238 if ( strcmp(ext, ".pyc") == 0 ) { |
| 239 #endif /* macintosh */ | |
| 234 /* Try to run a pyc file. First, re-open in binary */ | 240 /* Try to run a pyc file. First, re-open in binary */ |
| 235 /* Don't close, done in main: fclose(fp); */ | 241 /* Don't close, done in main: fclose(fp); */ |
| 236 if( (fp = fopen(filename, "rb")) == NULL ) { | 242 if( (fp = fopen(filename, "rb")) == NULL ) { |
| 237 fprintf(stderr, "python: Can't reopen .pyc file\n"); | 243 fprintf(stderr, "python: Can't reopen .pyc file\n"); |
| 238 return -1; | 244 return -1; |
| 665 console_options.pause_atexit = 0; | 671 console_options.pause_atexit = 0; |
| 666 #endif | 672 #endif |
| 667 #ifdef __MWERKS__ | 673 #ifdef __MWERKS__ |
| 668 if (sts == 0) | 674 if (sts == 0) |
| 669 SIOUXSettings.autocloseonquit = 1; | 675 SIOUXSettings.autocloseonquit = 1; |
| 676 else | |
| 677 SIOUXSettings.showstatusline = 1; | |
| 670 #endif | 678 #endif |
| 671 exit(sts); | 679 exit(sts); |
| 672 #endif /* WITH_THREAD */ | 680 #endif /* WITH_THREAD */ |
| 673 /*NOTREACHED*/ | 681 /*NOTREACHED*/ |
| 674 } | 682 } |
