Commits

Tim Chase committed 51f486d

Use ast.literal_eval instead of ast.parse("__temp__ = " + s)

No need for extra variables when the ast module makes this so easy.

Comments (0)

Files changed (1)

cherrypy/lib/reprconf.py

             # e.g. IronPython 1.0.
             return eval(s)
 
-        p = ast.parse("__tempvalue__ = " + s)
-        return p.body[0].value
+        return ast.literal_eval(s)
 
     def build_Subscript(self, o):
         return self.build(o.value)[self.build(o.slice)]