[New-bugs-announce] [issue46510] Update Python2-style exception handling

Irit Katriel report at bugs.python.org
Tue Jan 25 02:41:04 EST 2022


New submission from Irit Katriel <iritkatriel at gmail.com>:

Following issue45711 the redundancy in exc_info is now explicit. This means that we can now safely update places that still use python2-style exception handling code, like:

            exc_type, exc_value = sys.exc_info()[:2]
            try:
                response = dumps(
                    Fault(1, "%s:%s" % (exc_type, exc_value)),
                    encoding=self.encoding, allow_none=self.allow_none)
                response = response.encode(self.encoding, 'xmlcharrefreplace')
            finally:
                # Break reference cycle
                exc_type = exc_value = None

----------
assignee: iritkatriel
components: Library (Lib)
messages: 411561
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: Update Python2-style exception handling
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46510>
_______________________________________


More information about the New-bugs-announce mailing list