Reduce the scope of the try in this code. This makes linters happier as they previously thought that fkso and fcpp might be used in the except block without having been initialized.
Also it seems we were asking ksc to write to fkso and fcpp while those files were kept open by the NamedTemporaryFile. Even though this seems to work (I was slightly surprised by that), it seems better to close the file before ksc writes to it.
Reduce the scope of the
try
in this code. This makes linters happier as they previously thought thatfkso
andfcpp
might be used in theexcept
block without having been initialized.Also it seems we were asking ksc to write to
fkso
andfcpp
while those files were kept open by theNamedTemporaryFile
. Even though this seems to work (I was slightly surprised by that), it seems better to close the file before ksc writes to it.