Use six and compat module to provide a python3 compatibility.