[PATCH] py3: prevent comparison with None in curses histedit (issue6196)

Denis Laxalde denis at laxalde.org
Tue Oct 15 10:14:59 UTC 2019


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1571134484 -7200
#      Tue Oct 15 12:14:44 2019 +0200
# Node ID ecfb39f6d22d9fb58b5b6981e346afc478e91ef5
# Parent  6a350194de7f29d4f9dda183ab6df1d210bd58ff
py3: prevent comparison with None in curses histedit (issue6196)

diff --git a/hgext/histedit.py b/hgext/histedit.py
index 7f8d9bd..3c8ebc4 100644
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1259,7 +1259,7 @@ def event(state, ch):
         return E_RESIZE
 
     lookup_ch = ch
-    if b'0' <= ch <= b'9':
+    if ch is not None and b'0' <= ch <= b'9':
         lookup_ch = b'0'
 
     curmode, prevmode = state[b'mode']


More information about the Mercurial-devel mailing list