Make this work on RHEL6 with Python 2.6

I have need to run this on RHEL6 where is Python 2.6. I have tried the construct works on 2.7 and 3.3 as well.