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/2002-March/021548.html below:

[Python-Dev] Breaking bug #411881 into manageable pieces

[Python-Dev] Breaking bug #411881 into manageable pieces [Python-Dev] Breaking bug #411881 into manageable piecesWalter Dörwald walter@livinglogic.de
Thu, 21 Mar 2002 11:13:36 +0100
Tim Peters wrote:
> [Aahz]
> 
>>May I suggest yet one more alteration:
>>
>>    try:
>>        ...code...
>>    except (KeyboardInterrupt,SystemExit):
>>        raise
>>    except:
>>        ...handler...
> 
> 
> Not unless you want to run around editing hundreds of modules.

Why can't we simply change the default for bare except clauses?
I.e.

try:
    ...
except:
    ...

gets equivalent to

try:
    ...
except StandardError:
    ...

To catch everything, write:

try:
    ...
except Exception:
    ...

What about string exceptions?

Bye,
    Walter Dörwald

-- 
Walter Dörwald · LivingLogic AG, Bayreuth/Germany · www.livinglogic.de




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