Skip to content
Permalink
Browse files

BF: exit newsUpdate thread gracefully if no connection

  • Loading branch information...
peircej committed Feb 5, 2019
1 parent 68e6f4a commit 84b7602c300fb947d15c31fae0ef1d8ddff7eea8
Showing with 6 additions and 1 deletion.
  1. +6 −1 psychopy/app/connections/news.py
@@ -19,7 +19,10 @@

def getNewsItems(app=None):
url = newsURL + "news_items.json"
resp = requests.get(url)
try:
resp = requests.get(url, timeout=0.5)
except requests.ConnectionError:
return None
if resp.status_code == 200:
try:
items = resp.json()
@@ -52,6 +55,8 @@ def showNews(app=None, checkPrev=True):
break
if not toShow:
return 0
else:
return 0

dlg = wx.Dialog(None, style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER,
size=(800, 400))

0 comments on commit 84b7602

Please sign in to comment.
You can’t perform that action at this time.