Avoid closing files multiple times in getInterpreter(#17665)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: fisker Cheung <lionkay@gmail.com>
This commit is contained in:
2 files changed
+19
-18
No files matched your search
@@ -0,0 +1,8 @@
|
||||
#### Avoid closing files multiple times (#17665 by @43081j)
|
||||
|
||||
When reading a file to infer the interpreter from a shebang, we use the
|
||||
`n-readlines` library to read the first line in order to get the shebang.
|
||||
|
||||
This library closes files when it reaches EOF, and we later try close the same
|
||||
files again. We now close files only if `n-readlines` did not already close
|
||||
them.
|
||||
Reference in new issue
Block a user