changeset 43679:7cf332318f62

encoding: make getcols() raise exception explicitly This helps pytype. File "mercurial/encoding.py", line 329, in getcols: bad option in return type [bad-return-type] Expected: bytes Actually returned: None
author Yuya Nishihara <yuya@tcha.org>
date Sat, 16 Nov 2019 15:43:21 +0900
parents 52e4bfebc4ba
children 3364a15f61f0
files mercurial/encoding.py
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/encoding.py	Sat Nov 16 12:19:43 2019 -0500
+++ b/mercurial/encoding.py	Sat Nov 16 15:43:21 2019 +0900
@@ -327,6 +327,7 @@
         t = s[start:x]
         if colwidth(t) == c:
             return t
+    raise ValueError('substring not found')
 
 
 def trim(s, width, ellipsis=b'', leftside=False):