From 15015ce8bedaa4953e094353d9c3cd4c8b3cad14 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 11 Nov 2012 15:57:28 -0500 Subject: I'm seeing exec() as a function having the same behavior here from 2.4 to 3.3. waiting on further detail what I'm missing here --- mako/compat.py | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'mako/compat.py') diff --git a/mako/compat.py b/mako/compat.py index c53091d..2dba143 100644 --- a/mako/compat.py +++ b/mako/compat.py @@ -126,36 +126,6 @@ if py3kwarning: else: callable = callable -################################################ -# cross-compatible exec_() -# Copyright (c) 2010-2012 Benjamin Peterson -if py3k: - import builtins - exec_ = getattr(builtins, "exec") - - - def reraise(tp, value, tb=None): - if value.__traceback__ is not tb: - raise value.with_traceback(tb) - raise value - - - print_ = getattr(builtins, "print") - del builtins - -else: - def exec_(code, globs=None, locs=None): - """Execute code in a namespace.""" - if globs is None: - frame = sys._getframe(1) - globs = frame.f_globals - if locs is None: - locs = frame.f_locals - del frame - elif locs is None: - locs = globs - exec("""exec code in globs, locs""") -################################################ ################################################ # cross-compatible metaclass implementation -- cgit v1.2.3