Package: python-pyparsing
Version: 2.0.2+dfsg1-1
Severity: normal

Line 400:

    def pop( self, *args, **kwargs):
        """Removes and returns item at specified index (default=last).
           Supports both list and dict semantics for pop(). If passed no
           argument or an integer argument, it will use list semantics
           and pop tokens from the list of parsed tokens. If passed a 
           non-integer argument (most likely a string), it will use dict
           semantics and pop the corresponding value from any defined 
           results names. A second default return value argument is 
           supported, just as in dict.pop()."""
        if not args:
            args = [-1]
        if 'default' in kwargs:
            args.append(kwargs['default'])
        if (isinstance(args[0], int) or
                        len(args) == 1 or
                        args[0] in self):
            ret = self[index]
            del self[index]
            return ret
        else:
            defaultvalue = args[1]
            return defaultvalue

Note the complete lack of any assignment to 'index'.
Replacing it with 'args[0]' looks like a reasonable fix.

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (700, 'testing'), (650, 'stable'), (600, 'unstable'), (550, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.14-rc7-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-pyparsing depends on:
ii  python  2.7.8-1

python-pyparsing recommends no packages.

python-pyparsing suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to