change to python3.4 syntax

I'm using your code for a python3.4 project of my own. This is what I changed till now, the test run without failing. I didn't test it under python2 though