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:
parent
e748ca50ca
commit
86f61a9906
@ -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()
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user