It would help a lot to keep the python hooks both python2.7 (precise) and python3 (quantal+) for the upgrade case where your hook maybe run with either pythons.
https://wiki.ubuntu.com/Python/3
Most of the time it's easy to accomplish with: from __future__ import print_function
Which is valid in both python2.6+ and python3.
Also note: Consider passing universal_newlines=True to subprocess.Popen() and friends to get text output directly.
Which nicely helps to deal with unicode vs bytes in python3 vs python2 cases.
It would help a lot to keep the python hooks both python2.7 (precise) and python3 (quantal+) for the upgrade case where your hook maybe run with either pythons.
https:/ /wiki.ubuntu. com/Python/ 3
Most of the time it's easy to accomplish with:
from __future__ import print_function
Which is valid in both python2.6+ and python3.
Also note: newlines= True to subprocess.Popen() and friends to get text output directly.
Consider passing universal_
Which nicely helps to deal with unicode vs bytes in python3 vs python2 cases.