Skip to content

Commit

Permalink
Fix connection error messages that messed up the terminal. Surprising…
Browse files Browse the repository at this point in the history
…ly caused by pip.
  • Loading branch information
ductin committed Oct 25, 2017
1 parent 8ef8049 commit e5ada24
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions vpnproxy_tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,14 @@ def get_csv(self, url, queue, proxy={}):
self.messages['debug'].appendleft(vpn_data)
queue.put((0, {}))

except requests.exceptions.ConnectionError as e:
self.messages['debug'].appendleft('ConnectionError')
self.messages['debug'].appendleft(' Connection to gate ' + url + ' failed')
queue.put((0, {}))
except requests.exceptions.ConnectTimeout as e:
self.messages['debug'].appendleft('ConnectionTimeout')
self.messages['debug'].appendleft(' Connection to gate ' + url + ' failed')
queue.put((0, {}))
except requests.exceptions.ConnectionError as e:
self.messages['debug'].appendleft('ConnectionError')
self.messages['debug'].appendleft(' Connection to gate ' + url + ' failed')
queue.put((0, {}))
except requests.exceptions.RequestException as e:
self.messages['debug'].appendleft(str(e))
self.messages['debug'].appendleft(' Connection to gate ' + url + ' failed')
Expand Down Expand Up @@ -1041,7 +1041,7 @@ def exit(self, loop, data=None):

# check_dependencies:
required = {'openvpn': 0, 'python-pip': 0, 'requests': 0, 'urwid': 0, 'wmctrl': 0}
for module in ['pip', 'requests', 'urwid']:
for module in ['requests', 'urwid', 'pip']:
try:
__import__(module, globals(), locals(), [], -1)
except ImportError:
Expand Down

0 comments on commit e5ada24

Please sign in to comment.