safe_eval: fix wrt whitespace on expressions.
authorP. Christeas <p_christ@hol.gr>
Mon, 21 Jun 2010 14:36:32 +0000 (17:36 +0300)
committerP. Christeas <p_christ@hol.gr>
Mon, 21 Jun 2010 14:36:32 +0000 (17:36 +0300)
commit4afe236b0c036f98d97a5d4bf30b630957599ef5
tree92c894cf6972f8c8a664e300c70b89d89fcbe1e6
parent419da67ee7a570c3adad9ddd6192393ff306e7fa
safe_eval: fix wrt whitespace on expressions.

Regular eval() would not care about leading whitespace. But, compile() would
break if lines start with space. Strip that.
Also, allow some exceptions to pass through, so that we can examine the
syntax errors etc.

bzr revid: p_christ@hol.gr-20100621143632-0hvrck77lterxjtl
bin/tools/safe_eval.py