Commit 1188d33f authored by David Johnson's avatar David Johnson

Fix a few bugs with single-arg instance functions.

parent 2c68bea8
......@@ -335,7 +335,7 @@ class InspectedFunction(object):
try:
argspec = inspect.getargspec(func)
# First, fill in any holes that metadata can provide.
if len(argspec.defaults) > 0:
if not argspec.defaults is None and len(argspec.defaults) > 0:
start = len(argspec.args) - len(argspec.defaults)
self.largs = argspec.args[0:start]
# Don't include self in the largs we expose via argparse!
......@@ -350,8 +350,13 @@ class InspectedFunction(object):
pass
else:
self.largs = argspec.args
# Don't include self in the largs we expose via argparse!
if not self.largs is None and 'self' in self.largs:
self.largs.remove('self')
pass
pass
if argspec.args[0] == 'self':
if not argspec.args is None and len(argspec.args) > 0 \
and argspec.args[0] == 'self':
self.isinstance = True
self.isclass = False
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment