Use repr(x) instead of the deprecated `x`.
Use print(x) instead of the deprecated print x.
Use 0o for octal instead of deprecated 0 and drop deprecated (and pointless) L.
Avoid deprecated string concatenation.
Use map() instead of the deprecated imap().
Use __code__ instead of the deprecated func_code.
Simply use b'\xff' instead of u'\xff'.encode('iso-8859-15').

This avoids the deprecated u''.
Use except Type as var instead of the deprecated except Type, var.