Change except clauses to use "as"

This increases the minimum supported version of Python to 2.6.

Signed-off-by: John Keeping <john@keeping.me.uk>
Support Python 3

Add a wrapper function for `check_output()` that also decodes the byte
stream from the command into a string.  In the two places where we call
`subprocess.Popen()` directly, apply the decoding function to each line
of the output.

Signed-off-by: John Keeping <john@keeping.me.uk>
Drop python2 detection logic

Since git-when-merged now works with Python 3, this is no longer needed.

Signed-off-by: John Keeping <john@keeping.me.uk>
Merge pull request #3 from johnkeeping/python3

Support Python 3 (at the expense of Python 2.5 compatibility).