[FIX] unmutable defaults in safe_eval

bzr revid: ls@numerigraphe.fr-20111107152640-t28rgkfs05jwduab
This commit is contained in:
Numerigraphe - Lionel Sausin 2011-11-07 16:26:40 +01:00
parent 9ed5cbb24c
commit 4651cf935e
1 changed files with 7 additions and 1 deletions

View File

@ -212,7 +212,13 @@ except ImportError:
node_or_string = node_or_string.body
return _convert(node_or_string)
def _import(name, globals={}, locals={}, fromlist=[], level=-1):
def _import(name, globals=None, locals=None, fromlist=None, level=-1):
if globals is None:
globals = {}
if locals is None:
locals = {}
if fromlist is None:
fromlist = []
if name in _ALLOWED_MODULES:
return __import__(name, globals, locals, level)
raise ImportError(name)