Closed adamchainz closed 1 month ago
there's a duplicate somewhere. this is relatively unfixable because there's no definitive end of a block
Isn't this sufficient? #971 . It seems to, at least.
This could be the duplicate issue which @asottile mentioned: https://github.com/asottile/pyupgrade/issues/931.
But I think @adamchainz is right, @asottile can you recheck this please?
there's a case that this creates a syntax error, I can't remember the exact one
The 'versioned branch' fixer currently removes comments after a dropped
if
block:The comment is outside of the block and should be preserved.
(Just fixed a similar issue in django-upgrade: https://github.com/adamchainz/django-upgrade/issues/495 .)