diff options
author | Paul McGuire <ptmcg@austin.rr.com> | 2014-08-16 05:20:39 +0000 |
---|---|---|
committer | Paul McGuire <ptmcg@austin.rr.com> | 2014-08-16 05:20:39 +0000 |
commit | b6bb2dfea7d97d013c4b69bd3b44d40daa45d792 (patch) | |
tree | c630b81da1a7910c53a226c6b85ece4ea215af18 /src/pyparsing.py | |
parent | d8fda71d992845980a56fb727db41b134fa9cfa0 (diff) | |
download | pyparsing-git-b6bb2dfea7d97d013c4b69bd3b44d40daa45d792.tar.gz |
Fixed bug in ParseResults __init__ method, when returning non-ParseResults types from parse actions that implement __eq__.
Diffstat (limited to 'src/pyparsing.py')
-rw-r--r-- | src/pyparsing.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pyparsing.py b/src/pyparsing.py index 1cc0185..7b82f71 100644 --- a/src/pyparsing.py +++ b/src/pyparsing.py @@ -58,7 +58,7 @@ The pyparsing module handles some of the problems that are typically vexing when """
__version__ = "2.0.3"
-__versionTime__ = "12 Aug 2014 09:57"
+__versionTime__ = "16 Aug 2014 00:12"
__author__ = "Paul McGuire <ptmcg@users.sourceforge.net>"
import string
@@ -300,7 +300,7 @@ class ParseResults(object): if isinstance(name,int):
name = _ustr(name) # will always return a str, but use _ustr for consistency
self.__name = name
- if not toklist in (None,'',[]):
+ if not (isinstance(toklist, (type(None), basestring, list)) and toklist in (None,'',[])):
if isinstance(toklist,basestring):
toklist = [ toklist ]
if asList:
|