diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-11-30 11:40:44 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-11-30 11:40:44 -0500 |
| commit | e45e4aa97d96421173da19d63f433795dad6e4e9 (patch) | |
| tree | 76b6da7639a8ad1a559647df49bef8649781cfe6 /lib/sqlalchemy/orm | |
| parent | 86e5419968be23b88ef7e2ba4de9ca6698f0540b (diff) | |
| parent | e8a5ed9c1cbc5e9f0aebffad5ea78abb16167778 (diff) | |
| download | sqlalchemy-e45e4aa97d96421173da19d63f433795dad6e4e9.tar.gz | |
Merge remote-tracking branch 'origin/pr/210'
Diffstat (limited to 'lib/sqlalchemy/orm')
| -rw-r--r-- | lib/sqlalchemy/orm/collections.py | 3 | ||||
| -rw-r--r-- | lib/sqlalchemy/orm/events.py | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/collections.py b/lib/sqlalchemy/orm/collections.py index 4f988a8d4..b9145bae2 100644 --- a/lib/sqlalchemy/orm/collections.py +++ b/lib/sqlalchemy/orm/collections.py @@ -111,6 +111,7 @@ from ..sql import expression from .. import util, exc as sa_exc from . import base +from sqlalchemy.util.compat import inspect_getargspec __all__ = ['collection', 'collection_adapter', 'mapped_collection', 'column_mapped_collection', @@ -982,7 +983,7 @@ def _instrument_membership_mutator(method, before, argument, after): adapter.""" # This isn't smart enough to handle @adds(1) for 'def fn(self, (a, b))' if before: - fn_args = list(util.flatten_iterator(inspect.getargspec(method)[0])) + fn_args = list(util.flatten_iterator(inspect_getargspec(method)[0])) if isinstance(argument, int): pos_arg = argument named_arg = len(fn_args) > argument and fn_args[argument] or None diff --git a/lib/sqlalchemy/orm/events.py b/lib/sqlalchemy/orm/events.py index 671585e81..c13cb5a44 100644 --- a/lib/sqlalchemy/orm/events.py +++ b/lib/sqlalchemy/orm/events.py @@ -18,6 +18,7 @@ from .session import Session, sessionmaker from .scoping import scoped_session from .attributes import QueryableAttribute from .query import Query +from sqlalchemy.util.compat import inspect_getargspec class InstrumentationEvents(event.Events): """Events related to class instrumentation events. @@ -603,7 +604,7 @@ class MapperEvents(event.Events): meth = getattr(cls, identifier) try: target_index = \ - inspect.getargspec(meth)[0].index('target') - 1 + inspect_getargspec(meth)[0].index('target') - 1 except ValueError: target_index = None |
