[Python3] Initial modifications for Python3 support