Opened 8 years ago
Closed 8 years ago
#27006 closed Cleanup/optimization (wontfix)
Hints how to update code automatically to support Python3
Reported by: | Thomas Güttler | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.10 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I refer to this: https://docs.djangoproject.com/en/1.9/topics/python3/#exceptions
I think it would be friendly to new comers, if you give advices how to update your code to support Python3.
Changing from "except MyException as exc:" to "except MyException as exc:" can be automated.
You can update your code automatically with the futurize tool:
futurize --write --nobackups --fix lib2to3.fixes.fix_except your-directory/
What do you think?
Change History (1)
comment:1 by , 8 years ago
Component: | Uncategorized → Documentation |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
Type: | Uncategorized → Cleanup/optimization |
Note:
See TracTickets
for help on using tickets.
I don't think it's the job of Django's documentation to dive into specifics like that. The guide was written based on the experience of porting Django to Python 3 and I suppose we'll probably remove it after Django drops support for Python 2.