diff options
-rw-r--r-- | cherrypy/_cpconfig.py | 5 | ||||
-rw-r--r-- | cherrypy/lib/__init__.py | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/cherrypy/_cpconfig.py b/cherrypy/_cpconfig.py index bf93155e..acae17cc 100644 --- a/cherrypy/_cpconfig.py +++ b/cherrypy/_cpconfig.py @@ -343,8 +343,9 @@ class _Parser(ConfigParser.ConfigParser): try: value = unrepr(value) except Exception, x: - msg = ("Config error in section: %s, option: %s, value: %s" % - (repr(section), repr(option), repr(value))) + msg = ("Config error in section: %r, option: %r, " + "value: %r. Config values must be valid Python." % + (section, option, value)) raise ValueError(msg, x.__class__.__name__, x.args) result[section][option] = value return result diff --git a/cherrypy/lib/__init__.py b/cherrypy/lib/__init__.py index 3375ffd3..4e225cb1 100644 --- a/cherrypy/lib/__init__.py +++ b/cherrypy/lib/__init__.py @@ -128,7 +128,7 @@ def unrepr(s): # e.g. IronPython 1.0. return eval(s) - p = compiler.parse("a=" + s) + p = compiler.parse("__tempvalue__ = " + s) obj = p.getChildren()[1].getChildren()[0].getChildren()[1] return _Builder().build(obj) |