sol2
sol2 copied to clipboard
single.py - ResourceWarning: unclosed file
Running single.py outputs a resource warning (ResourceWarning: unclosed file). The warning is due to calling os.popen() and not closing the returned file object.
The fix is to wrap the os.popen() calls in a with statement.
This fix has been tested on Linux and resolves the warning.
See #1689 fix.