Skip to content

Instantly share code, notes, and snippets.

@flushentitypacket
Created June 8, 2020 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushentitypacket/eef6deebb0e6120090d9153bb86225ec to your computer and use it in GitHub Desktop.
Save flushentitypacket/eef6deebb0e6120090d9153bb86225ec to your computer and use it in GitHub Desktop.
# short test script to check whether request timeouts are affected by thread lock
import gevent
import gevent.monkey
import requests
import time
gevent.monkey.patch_all()
def get_ex():
return requests.get("https://example.com", timeout=0.1)
glet = gevent.spawn(get_ex)
time.sleep(5)
print("hi")
print(glet.value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment