comparison hgext/histedit.py @ 43228:0d609ed185ea

py3: prevent comparison with None in curses histedit (issue6196)
author Denis Laxalde <denis.laxalde@logilab.fr>
date Tue, 15 Oct 2019 12:14:44 +0200
parents 8ff1ecfadcd1
children d8215ff082da
comparison
equal deleted inserted replaced
43227:f02d3c0eed18 43228:0d609ed185ea
1257 1257
1258 if ch in (curses.KEY_RESIZE, b"KEY_RESIZE"): 1258 if ch in (curses.KEY_RESIZE, b"KEY_RESIZE"):
1259 return E_RESIZE 1259 return E_RESIZE
1260 1260
1261 lookup_ch = ch 1261 lookup_ch = ch
1262 if b'0' <= ch <= b'9': 1262 if ch is not None and b'0' <= ch <= b'9':
1263 lookup_ch = b'0' 1263 lookup_ch = b'0'
1264 1264
1265 curmode, prevmode = state[b'mode'] 1265 curmode, prevmode = state[b'mode']
1266 action = KEYTABLE[curmode].get( 1266 action = KEYTABLE[curmode].get(
1267 lookup_ch, KEYTABLE[b'global'].get(lookup_ch) 1267 lookup_ch, KEYTABLE[b'global'].get(lookup_ch)