Opened 6 years ago

Closed 6 years ago

#15609 closed (fixed)

Respect PEP 3109

Reported by: Daniel Duan Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords: PEP
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Tho porting to Python 3 has not started yet, there're things to be done without affecting the current support for Python (>2.4).

As mentioned in PEP 3109, one of Python's guiding maxims is "there should be one -- and preferably only one -- obvious way to do it". Specifically, raising exceptions with a message should be done in the ONE TRUE WAY since Python 1.5, as forced by Python 3:

raise E(V)

All this patch does is to respect this principle.

Attachments (1)

respect_pep3109.patch (4.1 KB) - added by Daniel Duan 6 years ago.

Download all attachments as: .zip

Change History (3)

Changed 6 years ago by Daniel Duan

Attachment: respect_pep3109.patch added

comment:1 Changed 6 years ago by Łukasz Rekucki

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedReady for checkin

No need to quote the Zen. This is a PEP 8 recommendation:

When raising an exception, use "raise ValueError('message')" instead of the older form "raise ValueError, 'message'".

comment:2 Changed 6 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

In [15811]:

Fixed #15609 -- Fixed some 'raise' statements to use the newer style syntax. Thanks, DaNmarner

Note: See TracTickets for help on using tickets.
Back to Top