make wrapper compatible with Python < 2.7

Work with 2.6 and possibly 2.4