I build an app compatible between Python 2 and 3. In order to provide compatibility between those two Python versions, I use six library.
My code uses sockets. Under Python 3 it is possible to create them using with
statement, but under Python 2 it claims on missing __exit__
attribute.
Is there any function of six providing disposable socket? If not, what solution would you consider as the most clear in this case?