]> kaliko git repositories - python-musicpd.git/commit
mpd.py: catch all exceptions raised by _hello()
authorJ. Alexander Treuman <jat@spatialrift.net>
Thu, 3 Apr 2008 04:23:36 +0000 (00:23 -0400)
committerJ. Alexander Treuman <jat@spatialrift.net>
Thu, 3 Apr 2008 04:23:36 +0000 (00:23 -0400)
commit8ab007756785772039ccbc4b650366e4a191bd58
tree359d2bf2ae7c86eba8b7a566d85c3865ace3df88
parent8c2ba17c359b5f1e6eacc560287802d6805788ed
mpd.py: catch all exceptions raised by _hello()

I normally consider it bad form to catch all exceptions, since it can
result in lost KeyboardInterrupts.  But in this case we re-raise the
exception after cleaning up, so it's ok.

While _hello() itself only raises socket.error or an MPDError subclass, a
KeyboardInterrupt would previously go uncaught.  Since the connection was
never cleaned up, it could be left in an unusable state.  So just
disconnect on all exceptions instead.
mpd.py