Patchwork [6,of,8] help: restore use of callable() since it was readded in Python 3.2

login
register
mail settings
Submitter Augie Fackler
Date June 24, 2014, 6:37 p.m.
Message ID <2bc882dca6c612558554.1403635062@augie-macbookair>
Download mbox | patch
Permalink /patch/5058/
State Accepted
Commit 8225bb1f0ad364a5ec42f0dd9df9b4e6c891e7e6
Headers show

Comments

Augie Fackler - June 24, 2014, 6:37 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1403529864 14400
#      Mon Jun 23 09:24:24 2014 -0400
# Node ID 2bc882dca6c612558554cd777c9e972b21f6e9c8
# Parent  0abeffaea6694e3c6009586c67d3194807ea32e0
help: restore use of callable() since it was readded in Python 3.2

Patch

diff --git a/mercurial/help.py b/mercurial/help.py
--- a/mercurial/help.py
+++ b/mercurial/help.py
@@ -404,7 +404,7 @@ 
         # description
         if not doc:
             rst.append("    %s\n" % _("(no help text available)"))
-        if util.safehasattr(doc, '__call__'):
+        if callable(doc):
             rst += ["    %s\n" % l for l in doc().splitlines()]
 
         if not ui.verbose: