use 'callable' to check if object is callable (B004)

This commit is contained in:
Daniel Eades
2022-01-10 13:51:35 +00:00
parent 72d352f64e
commit 61ff90460d
3 changed files with 5 additions and 5 deletions

View File

@@ -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