From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3C852A034F for ; Mon, 7 Feb 2022 15:19:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 37C9C410FD; Mon, 7 Feb 2022 15:19:52 +0100 (CET) Received: from mail-pl1-f228.google.com (mail-pl1-f228.google.com [209.85.214.228]) by mails.dpdk.org (Postfix) with ESMTP id 88F7141141 for ; Mon, 7 Feb 2022 15:19:51 +0100 (CET) Received: by mail-pl1-f228.google.com with SMTP id t9so9015914plg.13 for ; Mon, 07 Feb 2022 06:19:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VqDLmh3V2x5U9wM6r0HsD3z7CDnYNgQU5gxaCaw2FTk=; b=Gaxbr40XmdX4NLyPKvRdtqNjQxVtEaNx++I/BOXObPYm/guKjtR2868RNIGH2kLxPy VSrYpvhq8me4HoTiSjOapkIUq9z6lCiZ+LZDbKy1D76BkvfM78ggsRMRlOulWfTjBtgI y9iSGbt20FGpXAEGLWVKVZTkmavdye3qWwQyY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VqDLmh3V2x5U9wM6r0HsD3z7CDnYNgQU5gxaCaw2FTk=; b=ymc0LYk9mNQaDnzIrZJJ52N1zwTbOnJOKLvbpDWL7rPuymFsVoYsuWZCc0a1qmJOxp +yfov25t8EyuTGeVhZMXmaLXSsaTwa3EoDjtel3myoAo+yFXqzWzloeevSgDWIua8XZV LH5CW37Z5Qs64WgyNvTVRPaOcAyhxUsG6xJMMm6v8jcVZY1ujW3FpvEOEmiD0cQZ0hr3 GRwgQN6VfWGv9TxltDClAXWSAzghF69JvJ5lXztw/91CUqFZQJ3fQHKmZqTVkRjT1BBn eYzKabLiG/L795rcYG48VjW6CoTOIh60Kl58bG1hWZATzEjRrCziY67lrBvzARCOFmI8 I3EQ== X-Gm-Message-State: AOAM531fxd7fLkcCy/eXdPGWOKbvvZuF864QRde4/pVMUoAjEPD8L1D2 mSEj8Pbjj/Ak8/3J0a6SrV2z23cJdRiHaRRtzlPq94W2zvdnraiEO7iL9+yx4pL4n0UMTcdsQwK efgMxPheEE5BQOe3xJWZ6Ih826XqEekW4LwkZj/FZ27HLSrOqnru/mDA6XfmOpr8UmIQnX9fp X-Google-Smtp-Source: ABdhPJzIGO15WN3oRzbft3AkZEPMVgCZmz4KYBNxGBty5Nw9Ltnb/7LMNSpdtGFp5S+viYG29FX3gOaW5M7G X-Received: by 2002:a17:902:7242:: with SMTP id c2mr16751272pll.168.1644243590776; Mon, 07 Feb 2022 06:19:50 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id t2sm577864ply.20.2022.02.07.06.19.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Feb 2022 06:19:50 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::105d]) by postal.iol.unh.edu (Postfix) with ESMTP id B4F15605246B; Mon, 7 Feb 2022 09:19:49 -0500 (EST) From: ohilyard@iol.unh.edu To: ci@dpdk.org, alialnu@nvidia.com Cc: Owen Hilyard Subject: [PATCH v4 4/4] pw_maintainers_cli: fix crash caused by empty diff Date: Mon, 7 Feb 2022 09:19:43 -0500 Message-Id: <20220207141943.11673-4-ohilyard@iol.unh.edu> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220207141943.11673-1-ohilyard@iol.unh.edu> References: <20220207141943.11673-1-ohilyard@iol.unh.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: ci@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK CI discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ci-bounces@dpdk.org From: Owen Hilyard A sanity check has been added to find_filenames. Occasionally, due to how the community lab internally handles getting patches from patchworks, a patch will result in no diff. This patch adds handling for this case. Signed-off-by: Owen Hilyard --- tools/pw_maintainers_cli.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/pw_maintainers_cli.py b/tools/pw_maintainers_cli.py index 0705eee..975b62b 100755 --- a/tools/pw_maintainers_cli.py +++ b/tools/pw_maintainers_cli.py @@ -124,6 +124,11 @@ class Diff(object): - Moved _filename_re into the method. - Reduced newlines. """ + # sanity check diff + # for patches without any diff, it will try to run diff.replace + # while diff is None. just return an empty list + if diff is None: + return [] _filename_re = re.compile(r'^(---|\+\+\+) (\S+)') # normalise spaces diff = diff.replace('\r', '') -- 2.30.2