From patchwork Sat Mar 13 19:34:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D10210: crecord: null out the curses attribute with `None` on failure to import From: phabricator X-Patchwork-Id: 48524 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Sat, 13 Mar 2021 19:34:23 +0000 mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Pytype got really confused that this could be `Union[module, bool]`, and spewed about tons of attributes that are not available on `bool`. REPOSITORY rHG Mercurial BRANCH stable REVISION DETAIL https://phab.mercurial-scm.org/D10210 AFFECTED FILES mercurial/crecord.py CHANGE DETAILS To: mharbison72, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/mercurial/crecord.py b/mercurial/crecord.py --- a/mercurial/crecord.py +++ b/mercurial/crecord.py @@ -64,7 +64,7 @@ curses.error except (ImportError, AttributeError): - curses = False + curses = None class fallbackerror(error.Abort):