Opened 5 years ago

Closed 4 years ago

#18013 closed Cleanup/optimization (fixed)

Use `except ... as ...:` syntax to improve compatibility with Python3.

Reported by: Alex Ogier Owned by: nobody
Component: Python 3 Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

We are dropping python 2.5 support in django 1.5, so the old style with commas is no longer needed. This should make the diff with the Py3 guys much smaller.

Also a pull request, https://github.com/django/django/pull/134

Attachments (3)

except_as.diff (135.6 KB) - added by Alex Ogier 5 years ago.
except_as_noutils.diff (129.4 KB) - added by Alex Ogier 5 years ago.
Same without modifying utils/simplejson or utils/unittest
except_as_more.diff (1.2 KB) - added by Alex Ogier 5 years ago.
A few more cases from recent trunk changes

Download all attachments as: .zip

Change History (6)

Changed 5 years ago by Alex Ogier

Attachment: except_as.diff added

comment:1 Changed 5 years ago by Alex Gaynor

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

I see this modifies simplejson/ and unittest2/ those probably shouldn't be modified, as they're external packages.

Changed 5 years ago by Alex Ogier

Attachment: except_as_noutils.diff added

Same without modifying utils/simplejson or utils/unittest

Changed 5 years ago by Alex Ogier

Attachment: except_as_more.diff added

A few more cases from recent trunk changes

comment:2 Changed 4 years ago by anonymous

Triage Stage: UnreviewedAccepted

As soon as deprecated code is removed from trunk, we can begin to commit those sorts of on-the-road-to-python3 patches.

comment:3 Changed 4 years ago by Claude Paroz

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top