~ubuntu-branches/debian/sid/sqlalchemy/sid

« back to all changes in this revision

Viewing changes to lib/sqlalchemy/util/langhelpers.py

  • Committer: Package Import Robot
  • Author(s): Piotr Ożarowski
  • Date: 2012-01-29 23:29:50 UTC
  • mfrom: (1.4.18)
  • Revision ID: package-import@ubuntu.com-20120129232950-1mw4zn2xy2o51ua5
Tags: 0.7.5-1
* New upstream release
  - minumum required python-sphinx version bumped to 1.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# util/langhelpers.py
2
 
# Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file>
 
2
# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>
3
3
#
4
4
# This module is part of SQLAlchemy and is released under
5
5
# the MIT License: http://www.opensource.org/licenses/mit-license.php
15
15
import sys
16
16
import types
17
17
import warnings
18
 
from compat import update_wrapper, set_types, threading, callable, inspect_getfullargspec, py3k
 
18
from compat import update_wrapper, set_types, threading, callable, inspect_getfullargspec, py3k_warning
19
19
from sqlalchemy import exc
20
20
 
21
21
def _unique_symbols(used, *bases):
162
162
    else:
163
163
        self_arg = None
164
164
 
165
 
    if py3k:
166
 
        apply_pos = inspect.formatargspec(spec[0], spec[1], spec[2], None, spec[4])
167
 
        num_defaults = 0
168
 
        if spec[3]:
169
 
            num_defaults += len(spec[3])
170
 
        if spec[4]:
171
 
            num_defaults += len(spec[4])
172
 
        name_args = spec[0] + spec[4]
173
 
    else:
174
 
        apply_pos = inspect.formatargspec(spec[0], spec[1], spec[2])
175
 
        num_defaults = 0
176
 
        if spec[3]:
177
 
            num_defaults += len(spec[3])
178
 
        name_args = spec[0]
 
165
    # Py3K
 
166
    #apply_pos = inspect.formatargspec(spec[0], spec[1], spec[2], None, spec[4])
 
167
    #num_defaults = 0
 
168
    #if spec[3]:
 
169
    #    num_defaults += len(spec[3])
 
170
    #if spec[4]:
 
171
    #    num_defaults += len(spec[4])
 
172
    #name_args = spec[0] + spec[4]
 
173
    # Py2K
 
174
    apply_pos = inspect.formatargspec(spec[0], spec[1], spec[2])
 
175
    num_defaults = 0
 
176
    if spec[3]:
 
177
        num_defaults += len(spec[3])
 
178
    name_args = spec[0]
 
179
    # end Py2K
179
180
 
180
181
    if num_defaults:
181
182
        defaulted_vals = name_args[0-num_defaults:]
859
860
    If msg is a string, :class:`.exc.SAWarning` is used as
860
861
    the category.
861
862
 
862
 
    .. note:: This function is swapped out when the test suite
 
863
    .. note:: 
 
864
     
 
865
       This function is swapped out when the test suite
863
866
       runs, with a compatible version that uses
864
867
       warnings.warn_explicit, so that the warnings registry can
865
868
       be controlled.