Mercurial > cpython-lru_cache-weakref
diff Python/import.c @ 1886:ac6a9f90f6fd legacy-trunk
* Import/pythonrun.h, Python/{import,pythonrun}.c,
mac/macsetfiletype.c: changes by Jack to execute .pyc file passed
as command line argument. On the Mac .pyc files are given a
special type so they can be double-clicked
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 14 Sep 1994 13:31:04 +0000 |
| parents | 32d005faf5fc |
| children | 61c3c1a2fdb4 |
line wrap: on
line diff
--- a/Python/import.c Wed Sep 14 13:23:36 1994 +0000 +++ b/Python/import.c Wed Sep 14 13:31:04 1994 +0000 @@ -176,6 +176,14 @@ /* Forward */ static int init_builtin PROTO((char *)); +/* Helper for reading .pyc files */ + +long +get_pyc_magic() +{ + return MAGIC; +} + /* Initialization */ void @@ -482,6 +490,9 @@ /* Now write the code object to the ".pyc" file */ strcpy(namebuf + len, "c"); fpc = fopen(namebuf, "wb"); +#ifdef macintosh + setfiletype(namebuf, 'PYTH', 'PYC '); +#endif if (fpc == NULL) { if (verbose) fprintf(stderr,
