Patchwork py3: prevent comparison with None in curses histedit (issue6196)

login
register
mail settings
Submitter Denis Laxalde
Date Oct. 15, 2019, 10:14 a.m.
Message ID <ecfb39f6d22d9fb58b5b.1571134499@steppe.local>
Download mbox | patch
Permalink /patch/42350/
State Accepted
Headers show

Comments

Denis Laxalde - Oct. 15, 2019, 10:14 a.m.
# HG changeset patch
# User Denis Laxalde <denis.laxalde@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)
Yuya Nishihara - Oct. 15, 2019, 12:58 p.m.
On Tue, 15 Oct 2019 12:14:59 +0200, Denis Laxalde wrote:
> # HG changeset patch
> # User Denis Laxalde <denis.laxalde@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)

Queued, thanks.

Patch

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']