#5122 [py3] Migrate to 'except cls as e' syntax
Closed: Fixed None Opened 8 years ago by cheimes.

Python 3 has removed the comma separated except clause in favor for 'as'. The new syntax is supported since Python 2.6.

try:
   ...
except SomeException, exc:
   ...

becomes

try:
   ...
except SomeException as exc:
   ...

After #5120 has been committed I'm planning to use python-modernize to change all except clauses to the new syntax. The tool is based on lib2to3, which uses a Python grammar-aware parser. The migration is safe and won't introduce bugs.


All try/except blocks are compatible with Python 2 and Python 3 since FreeIPA 4.3.

Metadata Update from @cheimes:
- Issue assigned to someone
- Issue set to the milestone: FreeIPA Python 3 support

7 years ago

Login to comment on this ticket.

Metadata