File: green_http_doesnt_change_original_module.py

package info (click to toggle)
python-eventlet 0.26.1-7%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,916 kB
  • sloc: python: 24,898; makefile: 98
file content (8 lines) | stat: -rw-r--r-- 350 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
if __name__ == '__main__':
    # Importing eventlet.green.http.client after http.client was already imported
    # used to change the original http/http.client, that was breaking things.
    import http.client
    original_id = id(http.client)
    import eventlet.green.http.client  # noqa
    assert id(http.client) == original_id
    print('pass')