coleifer / micawber

a small library for extracting rich content from urls
http://micawber.readthedocs.org/
MIT License
635 stars 91 forks source link

Remove a redundant use of contextlib.closing() decorator #98

Closed mgorny closed 3 years ago

mgorny commented 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

coleifer commented 3 years ago

Thank you!