[#981] Add hack to avoid hanging tests in python 2.6