Issue #783: python3 compatible - cmp() is not a builtin in python 3.