[Zope-Checkins] SVN: zdaemon/branches/py3/src/zdaemon/zdctl.py Close sockets explicitly to avoid ResourceWarnings.

Marius Gedminas cvs-admin at zope.org
Thu Feb 14 11:15:47 UTC 2013


Log message for revision 129396:
  Close sockets explicitly to avoid ResourceWarnings.

Changed:
  U   zdaemon/branches/py3/src/zdaemon/zdctl.py

-=-
Modified: zdaemon/branches/py3/src/zdaemon/zdctl.py
===================================================================
--- zdaemon/branches/py3/src/zdaemon/zdctl.py	2013-02-14 11:15:45 UTC (rev 129395)
+++ zdaemon/branches/py3/src/zdaemon/zdctl.py	2013-02-14 11:15:47 UTC (rev 129396)
@@ -225,10 +225,11 @@
                 if not data:
                     break
                 response += data
-            sock.close()
             return response
         except socket.error as msg:
             return None
+        finally:
+            sock.close()
 
     zd_testing = 0
     def get_status(self):



More information about the Zope-Checkins mailing list