diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-01-14 12:22:40 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-01-15 10:01:53 -0500 |
| commit | 150ccf1716a41439c6ed9b06ac9cbf68fa5db1c4 (patch) | |
| tree | 4792d2f737b27b18d405855b4ab3c55555839827 /lib/sqlalchemy/orm/collections.py | |
| parent | b229a50c7786d8cbe65a2bf471b57a806f4259e3 (diff) | |
| download | sqlalchemy-150ccf1716a41439c6ed9b06ac9cbf68fa5db1c4.tar.gz | |
move to inspect_getfullargspec
Replace inspect_getargspec with inspect_getfullargspec
including a compatibility fallback for Py2k and use
getfullargspec fully.
Change-Id: I92bce0aafc37ce1a360b4f61b75f5892d0911c7e
Diffstat (limited to 'lib/sqlalchemy/orm/collections.py')
| -rw-r--r-- | lib/sqlalchemy/orm/collections.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/sqlalchemy/orm/collections.py b/lib/sqlalchemy/orm/collections.py index 427296ca2..1e561369f 100644 --- a/lib/sqlalchemy/orm/collections.py +++ b/lib/sqlalchemy/orm/collections.py @@ -106,7 +106,7 @@ through the adapter, allowing for some very sophisticated behavior. import operator import weakref -from sqlalchemy.util.compat import inspect_getargspec +from sqlalchemy.util.compat import inspect_getfullargspec from . import base from .. import exc as sa_exc from .. import util @@ -433,7 +433,7 @@ class collection(object): "The :meth:`.collection.linker` handler is deprecated and will " "be removed in a future release. Please refer to the " ":meth:`.AttributeEvents.init_collection` " - "and :meth:`.AttributeEvents.dispose_collection` event handlers. " + "and :meth:`.AttributeEvents.dispose_collection` event handlers. ", ) def linker(fn): """Tag the method as a "linked to attribute" event handler. @@ -463,7 +463,7 @@ class collection(object): "The :meth:`.collection.converter` method is deprecated and will " "be removed in a future release. Please refer to the " ":class:`.AttributeEvents.bulk_replace` listener interface in " - "conjunction with the :func:`.event.listen` function." + "conjunction with the :func:`.event.listen` function.", ) def converter(fn): """Tag the method as the collection converter. @@ -1008,7 +1008,9 @@ 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_getfullargspec(method)[0]) + ) if isinstance(argument, int): pos_arg = argument named_arg = len(fn_args) > argument and fn_args[argument] or None |
