diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-01-20 14:25:15 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-01-20 14:25:15 -0500 |
| commit | 79619c70e0cec3c9c210049679a7c0770bdcf56e (patch) | |
| tree | b389e2f7548b51ab545af68f0419278ffba79389 /lib/sqlalchemy | |
| parent | eee9b55f0ccaa5243442a59788acaa04be6ac6be (diff) | |
| download | sqlalchemy-79619c70e0cec3c9c210049679a7c0770bdcf56e.tar.gz | |
- use types.MethodType here for python3 compat
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/ext/hybrid.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/ext/hybrid.py b/lib/sqlalchemy/ext/hybrid.py index 56abdabd8..4cf33ffa8 100644 --- a/lib/sqlalchemy/ext/hybrid.py +++ b/lib/sqlalchemy/ext/hybrid.py @@ -289,7 +289,7 @@ SQL function to both sides:: """ from sqlalchemy import util from sqlalchemy.orm import attributes, interfaces -import new +types = __import__('types') class hybrid_method(object): """A decorator which allows definition of a Python object method with both @@ -320,9 +320,9 @@ class hybrid_method(object): def __get__(self, instance, owner): if instance is None: - return new.instancemethod(self.expr, owner, owner.__class__) + return types.MethodType(self.expr, owner, owner.__class__) else: - return new.instancemethod(self.func, instance, owner) + return types.MethodType(self.func, instance, owner) def expression(self, expr): """Provide a modifying decorator that defines a SQL-expression producing method.""" |
