while 1:
try:
print "It is getting blocked here"
jsonResponse=urlopen(request).read()
print "It is not reaching here"
break
except:
tries+=1
print "retry after 10 seconds",tries
time.sleep(10)
if tries>5:
print "Some Other time"
raise Exception('Server did not respond
此代码是表示用户界面的较大线程的一部分 一个奇怪的事情是当我使用python运行它时工作正常但是当我使用cx_freeze构建它然后运行.exe它阻止在urlopen()