Skip to content

Commit

Permalink
🔨 Replace range(len(...)) with enumerate(...) (#156)
Browse files Browse the repository at this point in the history
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
  • Loading branch information
deepsource-autofix[bot] committed Oct 12, 2022
1 parent c9b3fe5 commit 829c8a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions ck_hostloc.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ def get_points(self, s: req_Session, number_c: int):
self.log_current_points(s) # 打印账户当前积分
url_list = self.randomly_gen_uspace_url()
# 依次访问用户空间链接获取积分,出现错误时不中断程序继续尝试访问下一个链接
for i in range(len(url_list)):
url = url_list[i]
for i, url in enumerate(url_list):
try:
r = s.get(url)
r.raise_for_status()
Expand Down
4 changes: 2 additions & 2 deletions ck_nga.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ def view_video_for_adfree(self, token, uid):
failure_msg = ""
failure_msg_all = ""
code = {}
for i in range(len(ids)):
for i, item in enumerate(ids):
try:
res = requests.post(self.url, headers=self.headers, data=data).content
res = json.loads(res)
time.sleep(30)
code[i] = res["data"][1][0][ids[i]]["raw_stat"]["6"]
code[i] = res["data"][1][0][item]["raw_stat"]["6"]
if code[i] == 1:
success_sum += 1
else:
Expand Down

0 comments on commit 829c8a5

Please sign in to comment.