mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-29 18:16:52 +00:00
Ensure not to alter list in 'for' loop
This commit is contained in:
parent
9e28aaf275
commit
b0d44c7084
1 changed files with 4 additions and 3 deletions
|
|
@ -71,9 +71,10 @@ def fix_requirements(f):
|
|||
|
||||
# find and remove pkg-resources==0.0.0
|
||||
# which is automatically added by broken pip package under Debian
|
||||
for requirement in requirements:
|
||||
if requirement.value == b'pkg-resources==0.0.0\n':
|
||||
requirements.remove(requirement)
|
||||
requirements = [
|
||||
requirement for requirement in requirements
|
||||
if requirement.value != b'pkg-resources==0.0.0\n'
|
||||
]
|
||||
|
||||
for requirement in sorted(requirements):
|
||||
after.extend(requirement.comments)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue