Page MenuHomePhabricator

Merge #13747: tests: Skip P2PConnection's is_closing() check when not available

Authored by jasonbcox on Sep 6 2019, 17:12.



64b9f27e0e Skip is_closing() check when not available. (Daniel Kraft)

Pull request description:

#13715 introduced a new check for `_transport.is_closing()` in mininode's `P2PConnection`'s.  This function is [only available from Python 3.4.4](, though, while Bitcoin Core is supposed to support all Python 3.4 versions.

In this change, we make the check conditional on `is_closing` being available.  If it is not, then we revert to the behaviour before the check was introduced; this means that #13579 is not fixed for old systems, but at least the tests work as they used to do before.

This includes a small refactoring from a one-line lambda to an inline function, because this makes the code easier to read with more and more conditions being added.

Fixes #13745.

Tree-SHA512: 15be03b8b49c40a946c5b354c5974858d14dc46283ad48ee25d9e269377077ce741c6b379b3f6581ab981cb65be799809afbb99da278caaa2d8d870fa4fb748f

Backport of Core PR13747
Completes T677

Test Plan

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jasonbcox created this revision.Sep 6 2019, 17:12
Fabien accepted this revision.Sep 9 2019, 06:46
Fabien added a subscriber: Fabien.

We should migrate to support python >= 3.5 soon, but OK.

247 ↗(On Diff #11140)

Bitcoin ABC

This revision is now accepted and ready to land.Sep 9 2019, 06:46
jasonbcox updated this revision to Diff 11162.Sep 9 2019, 16:22

Rebase + nit