HomePhabricator

fix a potential regex search error in cdefs.py

Description

fix a potential regex search error in cdefs.py

Summary:
Running mypy on the functional tests folder raises this error:

test/functional/test_framework/cdefs.py:65: error: Item "None" of "Optional[Match[str]]" has no attribute "group"

This is caused by the fact that re.match may return None if the regex
doesn't match. Adding an explicit test for match is None catches such
situations and allows to print a more useful error message.

Test Plan: ninja check-functional

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D9272

Details

Provenance
PiRKAuthored on Feb 24 2021, 15:33
PiRKPushed on Feb 24 2021, 17:21
Reviewer
Restricted Project
Differential Revision
D9272: fix a potential regex search error in cdefs.py
Parents
rABC89048c5c1310: Delete outdated "self tests" for the test framework
Branches
Unknown
Tags
Unknown