From 4ca92ac91c944b252caf8c2265e5854f839a66f4 Mon Sep 17 00:00:00 2001 From: Yurii Karabas <1998uriyyo@gmail.com> Date: Wed, 26 Aug 2020 09:35:21 +0300 Subject: [PATCH] Revert contains_standalone_comments function changes --- src/black/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/black/__init__.py b/src/black/__init__.py index 954b93c..96dd0e4 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -1546,10 +1546,11 @@ class Line: def contains_standalone_comments(self, depth_limit: int = sys.maxsize) -> bool: """If so, needs to be split before emitting.""" - return any( - leaf.type == STANDALONE_COMMENT and leaf.bracket_depth <= depth_limit - for leaf in self.leaves - ) + for leaf in self.leaves: + if leaf.type == STANDALONE_COMMENT and leaf.bracket_depth <= depth_limit: + return True + + return False def contains_uncollapsable_type_comments(self) -> bool: ignored_ids = set() -- 2.39.5