Support python 2.7 and version >= 3.3.

Signed-off-by: david <db@d1b.org>