Skip to content
Permalink
Browse files

get_func_args maximum recursion fix #728

  • Loading branch information
nramirezuy authored and dangra committed Aug 8, 2014
1 parent f7c4ea8 commit 81344ea78b795e6243e21d6cdefc950b3ae2fe52
Showing with 3 additions and 0 deletions.
  1. +1 −0 scrapy/tests/test_utils_python.py
  2. +2 −0 scrapy/utils/python.py
@@ -193,6 +193,7 @@ def __call__(self, a, b, c):
# TODO: how do we fix this to return the actual argument names?
self.assertEqual(get_func_args(unicode.split), [])
self.assertEqual(get_func_args(" ".join), [])
self.assertEqual(get_func_args(operator.itemgetter(2)), [])

if __name__ == "__main__":
unittest.main()
@@ -162,6 +162,8 @@ def get_func_args(func, stripself=False):
elif hasattr(func, '__call__'):
if inspect.isroutine(func):
return []
elif getattr(func, '__name__', None) == '__call__':
return []
else:
return get_func_args(func.__call__, True)
else:

0 comments on commit 81344ea

Please sign in to comment.
You can’t perform that action at this time.