summaryrefslogtreecommitdiff
path: root/bin/tools
diff options
context:
space:
mode:
authorP. Christeas <p_christ@hol.gr>2009-09-10 02:48:00 +0300
committerP. Christeas <p_christ@hol.gr>2009-09-10 02:48:00 +0300
commitc65b07debb024771e38cc45b68f9363f4f8d6f63 (patch)
tree20e59e4660fc56b6dc886f5f927c2bc03c072146 /bin/tools
parent2a16b998922d901a33dc0859ebf5afe7382cca47 (diff)
safe_eval: make python 2.5 compatible.
bzr revid: p_christ@hol.gr-20090909234800-3u0a2fyi6673js4z
Diffstat (limited to 'bin/tools')
-rw-r--r--bin/tools/safe_eval.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/tools/safe_eval.py b/bin/tools/safe_eval.py
index 6f0a9b88fde..7c4da78375c 100644
--- a/bin/tools/safe_eval.py
+++ b/bin/tools/safe_eval.py
@@ -26,19 +26,22 @@
###############################################################################
__export_bis = {}
+import sys
def __init_ebis():
global __export_bis
- _evars = [ 'abs', 'all', 'any', 'basestring' , 'bin', 'bool',
+ _evars = [ 'abs', 'all', 'any', 'basestring' , 'bool',
'chr', 'cmp','complex', 'dict', 'divmod', 'enumerate',
- 'float','format', 'frozenset', 'getattr', 'hasattr', 'hash',
+ 'float', 'frozenset', 'getattr', 'hasattr', 'hash',
'hex', 'id','int', 'iter', 'len', 'list', 'long', 'map', 'max',
- 'min','next', 'oct', 'ord','pow', 'range', 'reduce', 'repr',
+ 'min', 'oct', 'ord','pow', 'range', 'reduce', 'repr',
'reversed', 'round', 'set', 'setattr', 'slice','sorted', 'str',
'sum', 'tuple','type', 'unichr','unicode', 'xrange',
'True','False', 'None', 'NotImplemented', 'Ellipsis', ]
+ if sys.version_info[0:2] >= (2,6):
+ _evars.extend(['bin', 'format', 'next'])
for v in _evars:
__export_bis[v] = __builtins__[v]