@@ -685,7 +685,10 @@ def __setstate__(self,state):
685685 def __dir__ (self ):
686686 return dir (super (ParseResults ,self )) + list (self ) # Python 3 compatible bgoli 20140728
687687
688- collections .MutableMapping .register (ParseResults )
688+ if PY_3 :
689+ collections .abc .MutableMapping
690+ else :
691+ collections .MutableMapping .register (ParseResults )
689692
690693def col (loc ,strg ):
691694 """Returns current column within a string, counting newlines as line separators.
@@ -2228,7 +2231,7 @@ def __init__( self, exprs, savelist = False ):
22282231
22292232 if isinstance ( exprs , basestring ):
22302233 self .exprs = [ Literal ( exprs ) ]
2231- elif isinstance ( exprs , collections .Sequence ):
2234+ elif isinstance ( exprs , collections .abc . Sequence ):
22322235 # if sequence of strings provided, wrap with Literal
22332236 if all (isinstance (expr , basestring ) for expr in exprs ):
22342237 exprs = map (Literal , exprs )
@@ -3233,7 +3236,7 @@ def oneOf( strs, caseless=False, useRegex=True ):
32333236
32343237 if isinstance (strs ,basestring ):
32353238 symbols = strs .split ()
3236- elif isinstance (strs , collections .Sequence ):
3239+ elif isinstance (strs , collections .abc . Sequence ):
32373240 symbols = list (strs [:])
32383241 elif isinstance (strs , _generatorType ):
32393242 symbols = list (strs )
0 commit comments