diff options
Diffstat (limited to 'lib/sqlalchemy/util/compat.py')
-rw-r--r-- | lib/sqlalchemy/util/compat.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/sqlalchemy/util/compat.py b/lib/sqlalchemy/util/compat.py index d866534ab..a89762b4e 100644 --- a/lib/sqlalchemy/util/compat.py +++ b/lib/sqlalchemy/util/compat.py @@ -22,7 +22,7 @@ pypy = hasattr(sys, 'pypy_version_info') win32 = sys.platform.startswith('win') cpython = not pypy and not jython # TODO: something better for this ? - +import collections next = next if py3k: @@ -33,6 +33,9 @@ else: except ImportError: import pickle +ArgSpec = collections.namedtuple("ArgSpec", + ["args", "varargs", "keywords", "defaults"]) + if py3k: import builtins @@ -43,6 +46,10 @@ if py3k: from io import BytesIO as byte_buffer + def inspect_getargspec(func): + return ArgSpec( + *inspect_getfullargspec(func)[0:4] + ) string_types = str, binary_type = bytes @@ -87,6 +94,7 @@ if py3k: else: from inspect import getargspec as inspect_getfullargspec + inspect_getargspec = inspect_getfullargspec from urllib import quote_plus, unquote_plus from urlparse import parse_qsl import ConfigParser as configparser |