def astnode(self, s):
        """Return a Python3 ast Node compiled from a string."""
        try:
            import ast
        except ImportError:
            # Fallback to eval when ast package is not available,
            # e.g. IronPython 1.0.
            return eval(s)

        p = ast.parse('__tempvalue__ = ' + s)
        return p.body[0].value
Return a Python3 ast Node compiled from a string.
cherrypy/lib/reprconf.py