mirror of
https://github.com/python/cpython.git
synced 2025-10-28 01:00:34 +00:00
* 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
This commit is contained in:
parent
956640880d
commit
fdef271550
2 changed files with 58 additions and 1 deletions
|
|
@ -176,6 +176,14 @@ static object *modules;
|
|||
/* Forward */
|
||||
static int init_builtin PROTO((char *));
|
||||
|
||||
/* Helper for reading .pyc files */
|
||||
|
||||
long
|
||||
get_pyc_magic()
|
||||
{
|
||||
return MAGIC;
|
||||
}
|
||||
|
||||
/* Initialization */
|
||||
|
||||
void
|
||||
|
|
@ -482,6 +490,9 @@ get_module(m, name, m_ret)
|
|||
/* 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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue