Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e00637b

Browse files
committed
Removed extraneous fclose() in case of .pyc file argument
1 parent 234fd7e commit e00637b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/pythonrun.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ run_script(fp, filename)
202202
ext = filename + strlen(filename) - 4;
203203
if ( strcmp(ext, ".pyc") == 0 ) {
204204
/* Try to run a pyc file. First, re-open in binary */
205-
fclose(fp);
205+
/* Don't close, done in main: fclose(fp); */
206206
if( (fp = fopen(filename, "rb")) == NULL ) {
207207
fprintf(stderr, "python: Can't reopen .pyc file\n");
208208
return -1;

0 commit comments

Comments
 (0)