scripts: Remove Python 2 import workarounds #14947

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:remove-python-2-workarounds changing 4 files +4 −18
  1. practicalswift commented at 1:54 PM on December 13, 2018: contributor

    Remove Python 2 import workarounds.

    As noted by @jnewbery in #14903 (review):

    This exception handling is a vestige from when github-merge.py supported Python 2 and Python 3. We only support Python 3 now so we should be able to remove it entirely and just import from urllib.request.

  2. fanquake added the label Tests on Dec 13, 2018
  3. fanquake added the label Scripts and tools on Dec 13, 2018
  4. practicalswift renamed this:
    Remove Python 2 import workarounds
    scripts: Remove Python 2 import workarounds
    on Dec 13, 2018
  5. fanquake commented at 2:25 PM on December 13, 2018: member

    utACK 9c5ca39

  6. fanquake requested review from jnewbery on Dec 13, 2018
  7. laanwj commented at 2:54 PM on December 13, 2018: member

    Apparently I merged #14903 too soon, sorry.

  8. jnewbery commented at 3:08 PM on December 13, 2018: member

    Apparently I merged #14903 too soon, sorry.

    Nah. Better is better! Plus, I only noticed it and commented because mergebot told me about it!

  9. in contrib/linearize/linearize-hashes.py:11 in 9c5ca399c5 outdated
       7 | @@ -8,10 +8,7 @@
       8 |  #
       9 |  
      10 |  from __future__ import print_function
      11 | -try: # Python 3
      12 | -    import http.client as httplib
      13 | -except ImportError: # Python 2
      14 | -    import httplib
      15 | +import http.client as httplib
    


    jnewbery commented at 3:11 PM on December 13, 2018:

    Keeping this alias seems strange. I think better to just import the one symbol that is being used:

    from http.client import HttpConnection

    (and then change httplib.HTTPConnection to HTTPConnection lower down)

  10. jnewbery commented at 3:16 PM on December 13, 2018: member

    Looks good. Perhaps worth removing all of the from __future__ import ... statements in the same PR? I count 4 of them across the project (all in modules that start with a Python3 shebang).

  11. practicalswift force-pushed on Dec 13, 2018
  12. practicalswift commented at 3:42 PM on December 13, 2018: contributor

    @jnewbery Good points! Feedback addressed. Please re-review :-)

  13. Remove Python 2 import workarounds 4de11a3682
  14. practicalswift force-pushed on Dec 13, 2018
  15. jnewbery commented at 4:25 PM on December 13, 2018: member

    utACK 4de11a3682cc46fa2f81af8961eef360bedfa3a6

  16. MarcoFalke merged this on Dec 13, 2018
  17. MarcoFalke closed this on Dec 13, 2018

  18. MarcoFalke referenced this in commit 9a43344430 on Dec 13, 2018
  19. practicalswift deleted the branch on Apr 10, 2021
  20. pravblockc referenced this in commit 9dd702cd5a on Aug 2, 2021
  21. pravblockc referenced this in commit a41ca898dc on Aug 3, 2021
  22. pravblockc referenced this in commit a309982e82 on Aug 3, 2021
  23. DrahtBot locked this on Aug 18, 2022

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-16 15:15 UTC

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