comparison Python/pythonrun.c @ 30979:86fdf8fe7f17 legacy-trunk

Getting rid of all the code inside #ifdef macintosh too.
author Jack Jansen <jack.jansen@cwi.nl>
date Thu, 20 Nov 2003 01:44:59 +0000
parents b6c139544c16
children f69589179c55
comparison
equal deleted inserted replaced
30978:4c8160088b34 30979:86fdf8fe7f17
25 #ifdef MS_WINDOWS 25 #ifdef MS_WINDOWS
26 #undef BYTE 26 #undef BYTE
27 #include "windows.h" 27 #include "windows.h"
28 #endif 28 #endif
29 29
30 #ifdef macintosh
31 #include "macglue.h"
32 #endif
33 extern char *Py_GetPath(void); 30 extern char *Py_GetPath(void);
34 31
35 extern grammar _PyParser_Grammar; /* From graminit.c */ 32 extern grammar _PyParser_Grammar; /* From graminit.c */
36 33
37 /* Forward */ 34 /* Forward */
752 static int 749 static int
753 maybe_pyc_file(FILE *fp, const char* filename, const char* ext, int closeit) 750 maybe_pyc_file(FILE *fp, const char* filename, const char* ext, int closeit)
754 { 751 {
755 if (strcmp(ext, ".pyc") == 0 || strcmp(ext, ".pyo") == 0) 752 if (strcmp(ext, ".pyc") == 0 || strcmp(ext, ".pyo") == 0)
756 return 1; 753 return 1;
757
758 #ifdef macintosh
759 /* On a mac, we also assume a pyc file for types 'PYC ' and 'APPL' */
760 if (PyMac_getfiletype((char *)filename) == 'PYC '
761 || PyMac_getfiletype((char *)filename) == 'APPL')
762 return 1;
763 #endif /* macintosh */
764 754
765 /* Only look into the file if we are allowed to close it, since 755 /* Only look into the file if we are allowed to close it, since
766 it then should also be seekable. */ 756 it then should also be seekable. */
767 if (closeit) { 757 if (closeit) {
768 /* Read only two bytes of the magic. If the file was opened in 758 /* Read only two bytes of the magic. If the file was opened in
1540 void 1530 void
1541 Py_Exit(int sts) 1531 Py_Exit(int sts)
1542 { 1532 {
1543 Py_Finalize(); 1533 Py_Finalize();
1544 1534
1545 #ifdef macintosh
1546 PyMac_Exit(sts);
1547 #else
1548 exit(sts); 1535 exit(sts);
1549 #endif
1550 } 1536 }
1551 1537
1552 static void 1538 static void
1553 initsigs(void) 1539 initsigs(void)
1554 { 1540 {