Fixed deprecation warning on Python 3