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',
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
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.
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
from .. import util
import inspect
import contextlib
+from sqlalchemy.util.compat import inspect_getargspec
def skip_if(predicate, reason=None):
class LambdaPredicate(Predicate):
def __init__(self, lambda_, description=None, args=None, kw=None):
- spec = inspect.getargspec(lambda_)
+ spec = inspect_getargspec(lambda_)
if not spec[0]:
self.lambda_ = lambda db: lambda_()
else:
"""
try:
- return inspect.getargspec(method)
+ return compat.inspect_getargspec(method)
except TypeError:
if method is object.__init__:
return (['self'], None, None, None)
for i, insp in enumerate(to_inspect):
try:
(_args, _vargs, vkw, defaults) = \
- inspect.getargspec(insp.__init__)
+ compat.inspect_getargspec(insp.__init__)
except TypeError:
continue
else:
except AttributeError:
continue
try:
- spec = inspect.getargspec(fn)
+ spec = compat.inspect_getargspec(fn)
fn_args = inspect.formatargspec(spec[0])
d_args = inspect.formatargspec(spec[0][1:])
except TypeError:
m = re.match(fn_reg, key)
if m:
fn = clsdict[key]
- spec = inspect.getargspec(fn)
+ spec = compat.inspect_getargspec(fn)
if not spec.keywords:
clsdict[key] = wrapped = cls._wrap_w_kw(fn)
setattr(cls, key, wrapped)
from sqlalchemy.testing import fixtures
from test.orm import _fixtures
from sqlalchemy import event, ForeignKey
+from sqlalchemy.util.compat import inspect_getargspec
class ExecutionTest(_fixtures.FixtureTest):
for meth in Session.public_methods:
if meth in blacklist:
continue
- spec = inspect.getargspec(getattr(Session, meth))
+ spec = inspect_getargspec(getattr(Session, meth))
if len(spec[0]) > 1 or spec[1]:
ok.add(meth)
return ok