Daniel Holth added the comment: Superceded by http://bugs.python.org/issue27134 , a simpler solution providing a with StrBytesRaises(): context manager. ---------- _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue18373> _______________________________________