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

pull domob1812 wants to merge 1 commits into bitcoin:master from domob1812:skip-isclosing changing 1 files +11 −1
  1. domob1812 commented at 12:47 PM on July 23, 2018: contributor

    #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.

  2. MarcoFalke commented at 12:51 PM on July 23, 2018: member

    utACK 4728553290aebd9fc22f08c8bc73b05a45fb388a

  3. fanquake added the label Tests on Jul 23, 2018
  4. marcoagner commented at 1:10 PM on July 23, 2018: contributor

    utACK 4728553290aebd9fc22f08c8bc73b05a45fb388a

  5. flack commented at 1:29 PM on July 23, 2018: contributor

    maybe add a note that this is to support python < 3.4.4, so that it's easier to find and remove this workaround when support for these versions is dropped

  6. Skip is_closing() check when not available.
    https://github.com/bitcoin/bitcoin/pull/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 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
    https://github.com/bitcoin/bitcoin/issues/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 https://github.com/bitcoin/bitcoin/issues/13745.
    64b9f27e0e
  7. domob1812 force-pushed on Jul 23, 2018
  8. domob1812 commented at 1:45 PM on July 23, 2018: contributor

    Added a comment as suggested by @flack.

  9. MarcoFalke merged this on Jul 23, 2018
  10. MarcoFalke closed this on Jul 23, 2018

  11. MarcoFalke referenced this in commit ab28b5b527 on Jul 23, 2018
  12. domob1812 deleted the branch on Jul 23, 2018
  13. domob1812 referenced this in commit 4d3285921f on Jul 30, 2018
  14. random-zebra referenced this in commit bffe509aed on Jun 28, 2021
  15. UdjinM6 referenced this in commit cf0d69952f on Jun 29, 2021
  16. UdjinM6 referenced this in commit 010ff7d499 on Jun 29, 2021
  17. UdjinM6 referenced this in commit 1395a6a01f on Jul 1, 2021
  18. UdjinM6 referenced this in commit 5f50a8c8ad on Jul 2, 2021
  19. UdjinM6 referenced this in commit ea58f30a6f on Jul 2, 2021
  20. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 21:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me