Bug 1275424 - Allow `map` in the moz.configure sandbox. r?glandium
This is useful for parsing semi-machinable command output into dicts.
MozReview-Commit-ID: 8bPTsOVBNyO
--- a/python/mozbuild/mozbuild/configure/__init__.py
+++ b/python/mozbuild/mozbuild/configure/__init__.py
@@ -92,17 +92,17 @@ class ConfigureSandbox(dict):
"""
# The default set of builtins. We expose unicode as str to make sandboxed
# files more python3-ready.
BUILTINS = ReadOnlyDict({
b: __builtins__[b]
for b in ('None', 'False', 'True', 'int', 'bool', 'any', 'all', 'len',
'list', 'tuple', 'set', 'dict', 'isinstance', 'getattr',
- 'hasattr', 'enumerate', 'range', 'zip')
+ 'hasattr', 'enumerate', 'range', 'map', 'zip')
}, __import__=forbidden_import, str=unicode)
# Expose a limited set of functions from os.path
OS = ReadOnlyNamespace(path=ReadOnlyNamespace(**{
k: getattr(mozpath, k, getattr(os.path, k))
for k in ('abspath', 'basename', 'dirname', 'exists', 'isabs', 'isdir',
'isfile', 'join', 'normcase', 'normpath', 'realpath',
'relpath')