User1342 commited on
Commit
22704b7
1 Parent(s): fa17331

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -147,8 +147,9 @@ def get_client_from_tokens(oauth_verifier, oauth_token):
147
  def block_user(user_id, user, reason):
148
  finished = False
149
  blocked = True
 
150
  while not finished:
151
- attempts = 0
152
  try:
153
  print("preparing to block {}".format(user_id))
154
  client.block(target_user_id=user_id)
@@ -162,9 +163,11 @@ def block_user(user_id, user, reason):
162
  print("waiting 15 minutes for rate limit to finish")
163
  time.sleep(900)
164
  attempts = attempts + 1
 
165
  else:
166
  finished = True
167
  blocked = False
 
168
  except tweepy.errors.BadRequest as e:
169
  print("bad request error")
170
  print(e)
 
147
  def block_user(user_id, user, reason):
148
  finished = False
149
  blocked = True
150
+ attempts = 0
151
  while not finished:
152
+
153
  try:
154
  print("preparing to block {}".format(user_id))
155
  client.block(target_user_id=user_id)
 
163
  print("waiting 15 minutes for rate limit to finish")
164
  time.sleep(900)
165
  attempts = attempts + 1
166
+ continue
167
  else:
168
  finished = True
169
  blocked = False
170
+ continue
171
  except tweepy.errors.BadRequest as e:
172
  print("bad request error")
173
  print(e)