Centralized PY2/3 compatibility