Skip to content

Commit

Permalink
catch KeyboardInterrupt, when not choosing topic (e.g. ).
Browse files Browse the repository at this point in the history
  • Loading branch information
iamaziz committed Oct 16, 2015
1 parent b841627 commit 63eafc4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions termfeed/feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,14 @@ def topic_choice(browse):

try:
m = '\nChoose the topic (number)? : '
try:
uin = raw_input(m)
except NameError:
try: # python 2
uin = raw_input(m)
except NameError: # python 3
uin = input(m)
uin = int(uin)
topic = tags[uin]
except ValueError:
print('invalid choice!')
except: # catch all exceptions
print('\nInvalid choice!')
topic = 'General'

else:
Expand Down

0 comments on commit 63eafc4

Please sign in to comment.