# HG changeset patch
# User Yuya Nishihara <y...@tcha.org>
# Date 1573886601 -32400
#      Sat Nov 16 15:43:21 2019 +0900
# Node ID 788e92d3589b8007e47db7533d01654911335cc5
# Parent  bde66eb4051df0c4ca952dcb306bd9a2fa238acb
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

diff --git a/mercurial/encoding.py b/mercurial/encoding.py
--- a/mercurial/encoding.py
+++ b/mercurial/encoding.py
@@ -327,6 +327,7 @@ def getcols(s, start, c):
         t = s[start:x]
         if colwidth(t) == c:
             return t
+    raise ValueError('substring not found')
 
 
 def trim(s, width, ellipsis=b'', leftside=False):
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to