added fix that allows regressions tests to work on pythons > 3.1