Skip to content

Commit

Permalink
Update a yield statement loop to a yield from statement
Browse files Browse the repository at this point in the history
Pylint added a new `use-yield-from` in [version 3.1]. This results in a
single linting error when running `tox`. This change updates a `yield`
within a loop to a `yield from` per the linter's recommendation.

[version 3.1]: https://pylint.readthedocs.io/en/stable/whatsnew/3/3.1/
  • Loading branch information
jonafato committed Mar 8, 2024
1 parent d64a637 commit 65e2225
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mailmerge/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,7 @@ def read_csv_database(database_path):
csvdialect.strict = True
reader = csv.DictReader(database_file, dialect=csvdialect)
try:
for row in reader:
yield row
yield from reader
except csv.Error as err:
raise exceptions.MailmergeError(
f"{database_path}:{reader.line_num}: {err}"
Expand Down

0 comments on commit 65e2225

Please sign in to comment.