Moved six import to the top as suggested by @mdboom