fixed repl for python 2 and 3 compatibility

fixes #25