Patchwork D7676: typing: add an assertion to util.versiontuple

login
register
mail settings
Submitter phabricator
Date Dec. 16, 2019, 4:13 a.m.
Message ID <differential-rev-PHID-DREV-wbxpzahzz2lf7o2sufrm-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43850/
State Superseded
Headers show

Comments

phabricator - Dec. 16, 2019, 4:13 a.m.
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Fixes the following warning:
  
    line 1177, in versiontuple: No attribute 'split' on None [attribute-error]
         In Optional[bytes]

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7676

AFFECTED FILES
  mercurial/util.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1173,6 +1173,8 @@ 
     else:
         vparts, extra = m.group(1), None
 
+    assert vparts is not None  # help pytype
+
     vints = []
     for i in vparts.split(b'.'):
         try: