Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 2022:eee3d715f0cf legacy-trunk
Removed extraneous fclose() in case of .pyc file argument
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Wed, 14 Dec 1994 12:58:37 +0000 |
| parents | a7f269610ec2 |
| children | d7e91437f0a2 |
comparison
equal
deleted
inserted
replaced
| 2021:ee12edfc2095 | 2022:eee3d715f0cf |
|---|---|
| 200 return -1; | 200 return -1; |
| 201 d = getmoduledict(m); | 201 d = getmoduledict(m); |
| 202 ext = filename + strlen(filename) - 4; | 202 ext = filename + strlen(filename) - 4; |
| 203 if ( strcmp(ext, ".pyc") == 0 ) { | 203 if ( strcmp(ext, ".pyc") == 0 ) { |
| 204 /* Try to run a pyc file. First, re-open in binary */ | 204 /* Try to run a pyc file. First, re-open in binary */ |
| 205 fclose(fp); | 205 /* Don't close, done in main: fclose(fp); */ |
| 206 if( (fp = fopen(filename, "rb")) == NULL ) { | 206 if( (fp = fopen(filename, "rb")) == NULL ) { |
| 207 fprintf(stderr, "python: Can't reopen .pyc file\n"); | 207 fprintf(stderr, "python: Can't reopen .pyc file\n"); |
| 208 return -1; | 208 return -1; |
| 209 } | 209 } |
| 210 v = run_pyc_file(fp, filename, d, d); | 210 v = run_pyc_file(fp, filename, d, d); |
