def METHOD_NAME(str):
    try:
        h = bytes.fromhex(str)
    except ValueError as e:
        try:
            # Try to pad with a '0' nibble in front
            h = bytes.fromhex('0' + str)
            print('Odd number of nibbles in hexadecimal string',
                  file=sys.stderr)
            raise e
        except ValueError:
            raise e
    return h