Skip to content

Commit

Permalink
update callable interface for 3.10 compatibility (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
brett committed Mar 8, 2022
1 parent 41acd49 commit 8bc8553
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chirp/pyPEG.py
Expand Up @@ -169,7 +169,7 @@ def syntaxError():
except:
pass

if isinstance(pattern, collections.Callable):
if isinstance(pattern, collections.abc.Callable):
if __debug__:
if print_trace:
try:
Expand All @@ -184,7 +184,7 @@ def syntaxError():
name = Name(pattern.__name__)

pattern = pattern()
if isinstance(pattern, collections.Callable):
if isinstance(pattern, collections.abc.Callable):
pattern = (pattern,)

text = skip(self.skipper, textline, skipWS, skipComments)
Expand Down Expand Up @@ -353,7 +353,7 @@ def parse(language, lineSource, skipWS=True, skipComments=None,
packrat=False, lineCount=True):
lines, lineNo = [], 0

while isinstance(language, collections.Callable):
while isinstance(language, collections.abc.Callable):
language = language()

orig, ld = "", 0
Expand Down

0 comments on commit 8bc8553

Please sign in to comment.