Make connection.py python3 compatible