The python-modernize utility from the modernize package is very useful for quickly updating Python 2 code to also support Python 3, but the changes it makes aren't always ideal (or even correct).  Here are some tips on how to improve its output.

If you have to make other changes to the code generated by python-modernize, please note them here.