summaryrefslogtreecommitdiff
path: root/src/pyparsing.py
diff options
context:
space:
mode:
authorPaul McGuire <ptmcg@austin.rr.com>2014-05-07 13:50:39 +0000
committerPaul McGuire <ptmcg@austin.rr.com>2014-05-07 13:50:39 +0000
commit17ba8caa0520bb4ac87d59e6596d0d142884c337 (patch)
tree0d2b4c3079710f1b3a260b7bb43f36b148d50dd9 /src/pyparsing.py
parent745755952fca3e5f0529f43724126c7275fe91f1 (diff)
downloadpyparsing-git-17ba8caa0520bb4ac87d59e6596d0d142884c337.tar.gz
Fixed Bug #73, errors introduced to ParseResults.pop method after improvements were made in last release
Diffstat (limited to 'src/pyparsing.py')
-rw-r--r--src/pyparsing.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pyparsing.py b/src/pyparsing.py
index c8db75a..9226936 100644
--- a/src/pyparsing.py
+++ b/src/pyparsing.py
@@ -414,11 +414,15 @@ class ParseResults(object):
supported, just as in dict.pop()."""
if not args:
args = [-1]
- if 'default' in kwargs:
- args.append(kwargs['default'])
+ for k,v in kwargs.items():
+ if k == 'default':
+ args = (args[0], v)
+ else:
+ raise TypeError("pop() got an unexpected keyword argument '%s'" % k)
if (isinstance(args[0], int) or
len(args) == 1 or
args[0] in self):
+ index = args[0]
ret = self[index]
del self[index]
return ret