A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-October/129771.html below:

[Python-Dev] An interesting exception handling quirk

[Python-Dev] An interesting exception handling quirk [Python-Dev] An interesting exception handling quirkArmin Rigo arigo at tunes.org
Sun Oct 20 08:08:53 CEST 2013
Hi Nick,

On Sat, Oct 19, 2013 at 1:41 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> recreating the *exact* exception subclass check from
> Python is actually difficult these days.

Can't it be done roughly like that?

   def __exit__(self, typ, val, tb):
        try:
            raise typ, val
        except self.exceptions:
            return True
        except:
            return False


A bientôt,

Armin.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4