diff options
Diffstat (limited to 'lib/sqlalchemy/util/langhelpers.py')
-rw-r--r-- | lib/sqlalchemy/util/langhelpers.py | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/lib/sqlalchemy/util/langhelpers.py b/lib/sqlalchemy/util/langhelpers.py index 722003796..f10ab3fb5 100644 --- a/lib/sqlalchemy/util/langhelpers.py +++ b/lib/sqlalchemy/util/langhelpers.py @@ -15,7 +15,7 @@ import re import sys import types import warnings -from compat import update_wrapper, set_types, threading, callable, inspect_getfullargspec, py3k +from compat import update_wrapper, set_types, threading, callable, inspect_getfullargspec, py3k_warning from sqlalchemy import exc def _unique_symbols(used, *bases): @@ -162,20 +162,21 @@ def format_argspec_plus(fn, grouped=True): else: self_arg = None - if py3k: - apply_pos = inspect.formatargspec(spec[0], spec[1], spec[2], None, spec[4]) - num_defaults = 0 - if spec[3]: - num_defaults += len(spec[3]) - if spec[4]: - num_defaults += len(spec[4]) - name_args = spec[0] + spec[4] - else: - apply_pos = inspect.formatargspec(spec[0], spec[1], spec[2]) - num_defaults = 0 - if spec[3]: - num_defaults += len(spec[3]) - name_args = spec[0] + # Py3K + #apply_pos = inspect.formatargspec(spec[0], spec[1], spec[2], None, spec[4]) + #num_defaults = 0 + #if spec[3]: + # num_defaults += len(spec[3]) + #if spec[4]: + # num_defaults += len(spec[4]) + #name_args = spec[0] + spec[4] + # Py2K + apply_pos = inspect.formatargspec(spec[0], spec[1], spec[2]) + num_defaults = 0 + if spec[3]: + num_defaults += len(spec[3]) + name_args = spec[0] + # end Py2K if num_defaults: defaulted_vals = name_args[0-num_defaults:] |