diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-05-04 16:23:27 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-05-04 16:23:27 -0400 |
| commit | 220fa91337aced11789b23065289203414f2063d (patch) | |
| tree | ce4fec18d671790bdcdab7dca707997229783d48 /lib/sqlalchemy/util | |
| parent | 8be6831f8be70d7946fd8e3e41b18781a1743ea7 (diff) | |
| download | sqlalchemy-220fa91337aced11789b23065289203414f2063d.tar.gz | |
most of ORM passing...
Diffstat (limited to 'lib/sqlalchemy/util')
| -rw-r--r-- | lib/sqlalchemy/util/compat.py | 7 | ||||
| -rw-r--r-- | lib/sqlalchemy/util/langhelpers.py | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/lib/sqlalchemy/util/compat.py b/lib/sqlalchemy/util/compat.py index 06bcd30dd..e8404c2df 100644 --- a/lib/sqlalchemy/util/compat.py +++ b/lib/sqlalchemy/util/compat.py @@ -184,8 +184,11 @@ else: if py3k: exec_ = getattr(builtins, 'exec') else: - def exec_(func_text, globals_, lcl): - exec('exec func_text in globals_, lcl') + def exec_(func_text, globals_, lcl=None): + if lcl is None: + exec('exec func_text in globals_') + else: + exec('exec func_text in globals_, lcl') def with_metaclass(meta, *bases): diff --git a/lib/sqlalchemy/util/langhelpers.py b/lib/sqlalchemy/util/langhelpers.py index 8a6af3758..4cb745c2b 100644 --- a/lib/sqlalchemy/util/langhelpers.py +++ b/lib/sqlalchemy/util/langhelpers.py @@ -499,7 +499,7 @@ def monkeypatch_proxied_specials(into_cls, from_cls, skip=None, only=None, "return %(name)s.%(method)s%(d_args)s" % locals()) env = from_instance is not None and {name: from_instance} or {} - compat.exec_(py, env, {}) + compat.exec_(py, env) try: env[method].__defaults__ = fn.__defaults__ except AttributeError: @@ -510,12 +510,7 @@ def monkeypatch_proxied_specials(into_cls, from_cls, skip=None, only=None, def methods_equivalent(meth1, meth2): """Return True if the two methods are the same implementation.""" -# start Py3K return getattr(meth1, '__func__', meth1) is getattr(meth2, '__func__', meth2) -# end Py3K -# start Py2K -# return getattr(meth1, 'im_func', meth1) is getattr(meth2, 'im_func', meth2) -# end Py2K def as_interface(obj, cls=None, methods=None, required=None): |
