46
47
# Safety class instance loader for unpickling.
47
48
# Inspired by http://nadiana.com/python-pickle-insecure#How_to_Make_Unpickling_Safer
49
51
def find_global(module, name):
50
52
if module not in SAFE_CLASSES or name not in SAFE_CLASSES[module]:
53
55
mod = sys.modules[module]
54
56
return getattr(mod, name)