Skip to content

Commit f9bc2ee

Browse files
authored
Fix bug in clean_game
I noticed a bug in `clean_game` in that if there is more than one variation, only the first is deleted because of deleting from a list during iteration. The fix was simple: use a reversed iterator to delete starting from the end instead.
1 parent 6a6ae60 commit f9bc2ee

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

annotator/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ def clean_game(game):
390390

391391
node.comment = None
392392
node.nags = []
393-
for variation in node.variations:
393+
for variation in reversed(node.variations):
394394
if not variation.is_main_variation():
395395
node.remove_variation(variation)
396396

0 commit comments

Comments
 (0)