Closed mgorny closed 3 years ago
Remove the unnecessary contextlib.closing() decorators from open() calls. The file objects returned by open() provide context manager API themselves and closing() is only necessary for external file-like objects that do not support it.
This should work even in Python 2.6, see: https://docs.python.org/2.6/library/stdtypes.html#file.close
Thank you!
Remove the unnecessary contextlib.closing() decorators from open() calls. The file objects returned by open() provide context manager API themselves and closing() is only necessary for external file-like objects that do not support it.
This should work even in Python 2.6, see: https://docs.python.org/2.6/library/stdtypes.html#file.close