diff options
author | David Beazley <dave@dabeaz.com> | 2015-08-25 14:43:14 -0500 |
---|---|---|
committer | David Beazley <dave@dabeaz.com> | 2015-08-25 14:43:14 -0500 |
commit | c2838c44b65abd3472edb07ab1f8f9c19646cb3f (patch) | |
tree | 513eed187b3b596e5c937ba97a401a9a20a9df7c | |
parent | 50e6b9df7b5e1680136fc795ad15d08f80e534b6 (diff) | |
parent | b360bf94960220b8f81db26e54ffacee6ed0c662 (diff) | |
download | ply-c2838c44b65abd3472edb07ab1f8f9c19646cb3f.tar.gz |
Merge pull request #70 from jvtrigueros/underscore-code
MethodType doesn't have __code__ attribute, use __func__
-rw-r--r-- | ply/yacc.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ply/yacc.py b/ply/yacc.py index 33064d4..dcb9679 100644 --- a/ply/yacc.py +++ b/ply/yacc.py @@ -3170,7 +3170,7 @@ class ParserReflect(object): if n.startswith('p_') and n != 'p_error': self.log.warning('%r not defined as a function', n) if ((isinstance(v, types.FunctionType) and v.__code__.co_argcount == 1) or - (isinstance(v, types.MethodType) and v.__code__.co_argcount == 2)): + (isinstance(v, types.MethodType) and v.__func__.__code__.co_argcount == 2)): if v.__doc__: try: doc = v.__doc__.split(' ') |