Merge 3.2
diff --git a/Lib/packaging/dist.py b/Lib/packaging/dist.py
index 3019b7c..4027d23 100644
--- a/Lib/packaging/dist.py
+++ b/Lib/packaging/dist.py
@@ -409,7 +409,7 @@
for help_option, short, desc, func in cmd_class.help_options:
if hasattr(opts, help_option.replace('-', '_')):
help_option_found = True
- if hasattr(func, '__call__'):
+ if callable(func):
func()
else:
raise PackagingClassError(
@@ -733,7 +733,7 @@
else:
hook_obj = hook
- if not hasattr(hook_obj, '__call__'):
+ if not callable(hook_obj):
raise PackagingOptionError('hook %r is not callable' % hook)
logger.info('running %s %s for command %s',