mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
use the py3k version of callable()
This commit is contained in:
@@ -137,7 +137,7 @@ class Config(object):
|
||||
if name not in self.values:
|
||||
raise AttributeError('No such config value: %s' % name)
|
||||
default = self.values[name][0]
|
||||
if callable(default):
|
||||
if hasattr(default, '__call__'):
|
||||
return default(self)
|
||||
return default
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ def between(marker, what=None, keepempty=False):
|
||||
def isdescriptor(x):
|
||||
"""Check if the object is some kind of descriptor."""
|
||||
for item in '__get__', '__set__', '__delete__':
|
||||
if callable(getattr(x, item, None)):
|
||||
if hasattr(getattr(x, item, None), '__call__'):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ def test_html(app):
|
||||
for path, check in paths.iteritems():
|
||||
nodes = list(etree.findall(path))
|
||||
assert nodes != []
|
||||
if callable(check):
|
||||
if hasattr(check, '__call__'):
|
||||
check(nodes)
|
||||
elif not check:
|
||||
# only check for node presence
|
||||
|
||||
Reference in New Issue
Block a user