summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose V. Trigueros <j.v.trigueros@gmail.com>2015-07-15 22:45:06 -0600
committerJose V. Trigueros <j.v.trigueros@gmail.com>2015-07-15 22:45:06 -0600
commitb360bf94960220b8f81db26e54ffacee6ed0c662 (patch)
tree8cdde709fb0f511627ba769ff150ec650942b285
parentdbf122652d38ba03ff9f9fe4aa9bee3693e6775f (diff)
downloadply-b360bf94960220b8f81db26e54ffacee6ed0c662.tar.gz
MethodType doesn't have __code__ attribute, use __func__
-rw-r--r--ply/yacc.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ply/yacc.py b/ply/yacc.py
index eb02cc2..c2ec541 100644
--- a/ply/yacc.py
+++ b/ply/yacc.py
@@ -3161,7 +3161,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(' ')