changeset 48013:376d08ae904f

util: eliminate the possibility of returning None from `versiontuple()` This fixes the following error flagged by pytype: File "/mnt/c/Users/Matt/hg/mercurial/extensions.py", line 228, in load: unsupported operand types for > [unsupported-operands] Primitive types 'Optional[tuple]' and 'curver: Optional[tuple]' are not comparable. Differential Revision: https://phab.mercurial-scm.org/D11473
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 20 Sep 2021 11:05:30 -0400
parents 406a7e629946
children 0dc4cc654d96
files mercurial/util.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Mon Sep 20 11:03:46 2021 -0400
+++ b/mercurial/util.py	Mon Sep 20 11:05:30 2021 -0400
@@ -1225,6 +1225,8 @@
     if n == 4:
         return (vints[0], vints[1], vints[2], extra)
 
+    raise error.ProgrammingError(b"invalid version part request: %d" % n)
+
 
 def cachefunc(func):
     '''cache the result of function calls'''