comparison mercurial/extensions.py @ 46397:90a92f041fc6 stable

typing: add an assertion instead of blacklisting mercurial/extensions.py Differential Revision: https://phab.mercurial-scm.org/D10175
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 11 Mar 2021 17:55:52 -0500
parents 1ced08423d59
children d4ba4d51f85f
comparison
equal deleted inserted replaced
46396:8408c3198ec1 46397:90a92f041fc6
910 def enabled(shortname=True): 910 def enabled(shortname=True):
911 '''return a dict of {name: desc} of extensions''' 911 '''return a dict of {name: desc} of extensions'''
912 exts = {} 912 exts = {}
913 for ename, ext in extensions(): 913 for ename, ext in extensions():
914 doc = gettext(ext.__doc__) or _(b'(no help text available)') 914 doc = gettext(ext.__doc__) or _(b'(no help text available)')
915 assert doc is not None # help pytype
915 if shortname: 916 if shortname:
916 ename = ename.split(b'.')[-1] 917 ename = ename.split(b'.')[-1]
917 exts[ename] = doc.splitlines()[0].strip() 918 exts[ename] = doc.splitlines()[0].strip()
918 919
919 return exts 920 return exts