Dinnerbone / mcstatus

A Python class for checking the status of an enabled Minecraft server
http://dinnerbone.com/minecraft/tools/status/
1.11k stars 146 forks source link

Implicitly close sockets in destructor methods #35

Closed zeroflow closed 7 years ago

zeroflow commented 9 years ago

TCP / UDP Sockets used in the Connection class dont get closed (so urllib3 was complaining).

Putting the .close() into del(self) will close it implicitly when Connection goes out of scope.

I'm not 100% sure if sockets got closed by GC before, but this cleans up the logfile when using mcstatus with bottlepy.