1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-22 04:12:52 +00:00

get_func_args maximum recursion fix #728

This commit is contained in:
nramirezuy 2014-07-17 19:07:13 -03:00
parent e748ca50ca
commit 86f61a9906
2 changed files with 3 additions and 0 deletions

View File

@ -193,6 +193,7 @@ class UtilsPythonTestCase(unittest.TestCase):
# 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()

View File

@ -147,6 +147,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: