Delete unused Error
[rainbowstream.git] / rainbowstream / rainbow.py
index 8dbd89c..53fcd63 100644 (file)
@@ -531,11 +531,10 @@ def reply_all():
     original_tweet = t.statuses.show(id=tid)
     text = original_tweet['text']
     nick_ary = [original_tweet['user']['screen_name']]
-    for user in tweet['entities']['user_mentions']:
-        if user['screen_name'] not in nick_ary:
+    for user in list(original_tweet['entities']['user_mentions']):
+        if user['screen_name'] not in nick_ary \
+                and user['screen_name'] != g['original_name']:
             nick_ary.append(user['screen_name'])
-    if g['original_name'] in nick_ary:
-        nick_ary.remove(g['original_name'])
     status = ' '.join(g['stuff'].split()[1:])
     status = ' '.join(['@' + nick for nick in nick_ary]) + ' ' + str2u(status)
     t.statuses.update(status=status, in_reply_to_status_id=tid)
@@ -2080,7 +2079,7 @@ def stream(domain, args, name='Rainbow Stream'):
         detail_twitter_error(e)
         sys.stdout.write(g['decorated_name'](g['PREFIX']))
         sys.stdout.flush()
-    except (URLError, ConnectionResetError):
+    except (URLError):
         printNicely(
             magenta('There seems to be a connection problem.'))
         save_history()