Commit 01b64991 authored by Klaus Wölfel's avatar Klaus Wölfel

Restricted: allow np.dtype(dict)

parent 7253c852
...@@ -237,6 +237,9 @@ del alias, real ...@@ -237,6 +237,9 @@ del alias, real
orig_guarded_import = safe_builtins['__import__'] orig_guarded_import = safe_builtins['__import__']
def guarded_import(mname, globals=None, locals=None, fromlist=None, def guarded_import(mname, globals=None, locals=None, fromlist=None,
level=-1): level=-1):
# needed for np.dtype(dict)
if mname == "numpy.core._internal" and fromlist == ["__doc__"]:
return __import__(mname, globals, locals, fromlist, level)
for fromname in fromlist or (): for fromname in fromlist or ():
if fromname[:1] == '_': if fromname[:1] == '_':
raise Unauthorized(fromname) raise Unauthorized(fromname)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment