Backwards compatibility to Python2