Replace the use of string.maketrans with something that can also work with Python3