mirror of https://github.com/vitalif/openscad
Print error message if upload fails
parent
bd14e4bab3
commit
e9ace30cca
|
@ -36,9 +36,11 @@ import subprocess
|
||||||
import time
|
import time
|
||||||
import platform
|
import platform
|
||||||
try:
|
try:
|
||||||
|
from urllib.error import URLError
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode
|
||||||
except:
|
except:
|
||||||
|
from urllib2 import URLError
|
||||||
from urllib2 import urlopen
|
from urllib2 import urlopen
|
||||||
from urllib import urlencode
|
from urllib import urlencode
|
||||||
|
|
||||||
|
@ -386,7 +388,8 @@ def upload_html(page_url, title, html):
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
response = urlopen(page_url, data=postify(data))
|
response = urlopen(page_url, data=postify(data))
|
||||||
except:
|
except URLError, e:
|
||||||
|
print 'Upload error: ' + str(e)
|
||||||
return False
|
return False
|
||||||
return 'success' in response.read().decode()
|
return 'success' in response.read().decode()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue