]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
patman: Use defaultdict directly
authorSimon Glass <sjg@chromium.org>
Tue, 29 Apr 2025 13:22:23 +0000 (07:22 -0600)
committerSimon Glass <sjg@chromium.org>
Tue, 27 May 2025 09:07:41 +0000 (10:07 +0100)
Import defaultdict to avoid needing to specify its module in multiple
places. Fix an extra blank line while here.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/patman/status.py

index c114a432bf386faca57ec34e277d26f9d72d9fa7..8fc2a50b426f52bc0380f98952d362c2a5258888 100644 (file)
@@ -8,7 +8,7 @@ Allows creation of a new branch based on the old but with the review tags
 collected from patchwork.
 """
 
-import collections
+from collections import defaultdict
 import concurrent.futures
 from itertools import repeat
 
@@ -55,7 +55,7 @@ def process_reviews(content, comment_data, base_rtags):
         list of patchwork.Review: reviews received on the patch
     """
     pstrm = patchstream.PatchStream.process_text(content, True)
-    rtags = collections.defaultdict(set)
+    rtags = defaultdict(set)
     for response, people in pstrm.commit.rtags.items():
         rtags[response].update(people)
 
@@ -70,7 +70,7 @@ def process_reviews(content, comment_data, base_rtags):
             rtags[response].update(people)
 
     # Find the tags that are not in the commit
-    new_rtags = collections.defaultdict(set)
+    new_rtags = defaultdict(set)
     for tag, people in rtags.items():
         for who in people:
             is_new = (tag not in base_rtags or
@@ -115,7 +115,6 @@ def compare_with_series(series, patches):
             warnings.append("Cannot find patch for commit %d ('%s')" %
                             (seq + 1, cmt.subject))
 
-
     # Check the names match
     commit_for_patch = {}
     all_commits = set(series.commits)