Patchwork [5,of,8] fancyopts: 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 <0abeffaea6694e3c6009.1403635061@augie-macbookair>
Download mbox | patch
Permalink /patch/5057/
State Accepted
Commit 753af9ee7c811d16af668c40072c597608da2a7b
Headers show

Comments

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

Patch

diff --git a/mercurial/fancyopts.py b/mercurial/fancyopts.py
--- a/mercurial/fancyopts.py
+++ b/mercurial/fancyopts.py
@@ -77,7 +77,7 @@ 
         # copy defaults to state
         if isinstance(default, list):
             state[name] = default[:]
-        elif getattr(default, '__call__', False):
+        elif callable(default):
             state[name] = None
         else:
             state[name] = default