encoding: make getcols() raise exception explicitly
authorYuya Nishihara <yuya@tcha.org>
Sat, 16 Nov 2019 15:43:21 +0900
changeset 43679 7cf332318f62
parent 43678 52e4bfebc4ba
child 43680 3364a15f61f0
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
mercurial/encoding.py
--- 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):