Fix XenAPI.py on python2.7

This fix was made by Mike Mcclurg here:

https://bugs.launchpad.net/xcp/+bug/917913

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Merge pull request #1471 from djs55/python2.7

Fix XenAPI.py on python2.7