Closes #13258: Use callable() built-in in the standard library.
diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py
index 388bfe3..5a57288 100644
--- a/Lib/multiprocessing/managers.py
+++ b/Lib/multiprocessing/managers.py
@@ -134,7 +134,7 @@
temp = []
for name in dir(obj):
func = getattr(obj, name)
- if hasattr(func, '__call__'):
+ if callable(func):
temp.append(name)
return temp
@@ -510,7 +510,7 @@
'''
assert self._state.value == State.INITIAL
- if initializer is not None and not hasattr(initializer, '__call__'):
+ if initializer is not None and not callable(initializer):
raise TypeError('initializer must be a callable')
# pipe over which we will retrieve address of server