def __exit__(self, *args): Thanks guys. This is the solution I implemented and it works great. Mark :) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/tutor/attachments/20111210/1b3ef1e6/attachment.html>