mercurial/extensions.py
changeset 45899 f96059fa519c
parent 45105 5d09a120b4be
child 45942 89a2afe31e82
child 46025 27c23c8f14da
--- a/mercurial/extensions.py	Sat Nov 21 15:34:54 2020 -0500
+++ b/mercurial/extensions.py	Sat Nov 21 16:55:07 2020 -0500
@@ -222,13 +222,16 @@
     # extensions short circuit when loaded with a known incompatible version
     # of Mercurial.
     minver = getattr(mod, 'minimumhgversion', None)
-    if minver and util.versiontuple(minver, 2) > util.versiontuple(n=2):
-        msg = _(
-            b'(third party extension %s requires version %s or newer '
-            b'of Mercurial (current: %s); disabling)\n'
-        )
-        ui.warn(msg % (shortname, minver, util.version()))
-        return
+    if minver:
+        curver = util.versiontuple(n=2)
+
+        if None in curver or util.versiontuple(minver, 2) > curver:
+            msg = _(
+                b'(third party extension %s requires version %s or newer '
+                b'of Mercurial (current: %s); disabling)\n'
+            )
+            ui.warn(msg % (shortname, minver, util.version()))
+            return
     ui.log(b'extension', b'    - validating extension tables: %s\n', shortname)
     _validatetables(ui, mod)