Patchwork [2,of,2] color: use pythons isinstance method instead of reprogramming it

login
register
mail settings
Submitter Simon Heimberg
Date June 5, 2013, 9:19 p.m.
Message ID <44eb3e9c5f565c9e54eb.1370467150@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/1706/
State Accepted
Commit 6cd8403e070fc02dda5e11d911cf1a6920a112ac
Headers show

Comments

Simon Heimberg - June 5, 2013, 9:19 p.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1370462776 -7200
# Node ID 44eb3e9c5f565c9e54eb4e260f00b9bdfef83a86
# Parent  c6aff923ecc418577244e7c3f1e73b6ba8804154
color: use pythons isinstance method instead of reprogramming it

Patch

diff -r c6aff923ecc4 -r 44eb3e9c5f56 hgext/color.py
--- a/hgext/color.py	Mit Jun 05 22:06:02 2013 +0200
+++ b/hgext/color.py	Mit Jun 05 22:06:16 2013 +0200
@@ -400,7 +400,7 @@ 
 def uisetup(ui):
     if ui.plain():
         return
-    if not issubclass(ui.__class__, colorui):
+    if not isinstance(ui, colorui):
         colorui.__bases__ = (ui.__class__,)
         ui.__class__ = colorui
     def colorcmd(orig, ui_, opts, cmd, cmdfunc):