mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
use 'callable' to check if object is callable (B004)
This commit is contained in:
@@ -99,7 +99,7 @@ def check_xpath(etree, fname, path, check, be_found=True):
|
||||
else:
|
||||
assert nodes != [], ('did not find any node matching xpath '
|
||||
'%r in file %s' % (path, fname))
|
||||
if hasattr(check, '__call__'):
|
||||
if callable(check):
|
||||
check(nodes)
|
||||
elif not check:
|
||||
# only check for node presence
|
||||
|
||||
Reference in New Issue
Block a user