compatibility with python 2.6 and make commoditycode optional in test.py