make it compatible with python 2.6
Merge branch 'rewrite-test-python2.6' into rewrite-test