Skip to content

Commit 6d30932

Browse files
committed
flake8: rename loop variable in 'for sendto in sendto:'
Flake8 reported 'B020 Found for loop that reassigns the iterable it is iterating with each iterable value.' Renamed loop variable to to_addr. There is a similar construct with a loop over bcc_sendto with a 'bcc' loop variable. So I assume the loop varaible can be chnaged w/o issue. Codecov shows all the affected lines are being tested and the tests I ran with testmon that should cover that code all passed. We shall see if a full CI run passes.
1 parent 401e179 commit 6d30932

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Fixed:
2525
- issue2551283 - fail if version 2.4.9 of markdown2 is used, it broke
2626
[issue1](issue1) style links. Support markdown2 2.4.8 and earlier
2727
and 2.4.10 with its new schema filtering method. (John Rouillard)
28+
- multiple flake8 fixes (John Rouillard)
29+
- rename loop variable in 'for sendto in sendto:' (John Rouillard)
2830

2931
Features:
3032

roundup/roundupdb.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ def send_message(self, issueid, msgid, note, sendto, from_address=None,
577577
# can't fiddle the recipients in the message ... worth testing
578578
# and/or fixing some day
579579
first = True
580-
for sendto in sendto:
580+
for to_addr in sendto:
581581
# create the message
582582
mailer = Mailer(self.db.config)
583583

@@ -721,18 +721,18 @@ def send_message(self, issueid, msgid, note, sendto, from_address=None,
721721
message.set_payload(body, message.get_charset())
722722

723723
if crypt:
724-
send_msg = self.encrypt_to(message, sendto)
724+
send_msg = self.encrypt_to(message, to_addr)
725725
else:
726726
send_msg = message
727-
mailer.set_message_attributes(send_msg, sendto, subject, author)
727+
mailer.set_message_attributes(send_msg, to_addr, subject, author)
728728
if crypt:
729729
send_msg['Message-Id'] = message['Message-Id']
730730
send_msg['Reply-To'] = message['Reply-To']
731731
if message.get('In-Reply-To'):
732732
send_msg['In-Reply-To'] = message['In-Reply-To']
733733

734-
if sendto:
735-
mailer.smtp_send(sendto, send_msg.as_string())
734+
if to_addr:
735+
mailer.smtp_send(to_addr, send_msg.as_string())
736736
if first:
737737
if crypt:
738738
# send individual bcc mails, otherwise receivers can

0 commit comments

Comments
 (0)