def SafeEval(evalstr, default=None, globalz=None, localz=None):
    """A safer wrapper for eval()."""

    if not globalz:
        globalz = {}
    if not localz:
        localz = {}
    try:
        return eval(evalstr, globalz, localz)
    except SyntaxError:
        return default if default else evalstr