Extended dotnetpad timeout to 10 seconds

This commit is contained in:
melonhead 2010-02-24 16:17:57 +00:00
parent 40bb91bb88
commit fcffce45f3
1 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ import json
from util import hook
def dotnetpad(lang, code):
def dotnetpad(lang, code, timeout=10):
"Posts a provided snippet of code in a provided langugage to dotnetpad.net"
code = code.encode('utf8')
@ -18,7 +18,7 @@ def dotnetpad(lang, code):
"Accept": "text/plain"}
try:
conn = httplib.HTTPConnection("dotnetpad.net:80")
conn = httplib.HTTPConnection("dotnetpad.net", 80, timeout=timeout)
conn.request("POST", "/Skybot", params, headers)
response = conn.getresponse()
except httplib.HTTPException: