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 4999BA034F for ; Mon, 7 Feb 2022 16:08:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 44F9D410EA; Mon, 7 Feb 2022 16:08:42 +0100 (CET) Received: from mail-pj1-f98.google.com (mail-pj1-f98.google.com [209.85.216.98]) by mails.dpdk.org (Postfix) with ESMTP id 014B5410FF for ; Mon, 7 Feb 2022 16:08:41 +0100 (CET) Received: by mail-pj1-f98.google.com with SMTP id my12-20020a17090b4c8c00b001b528ba1cd7so13827369pjb.1 for ; Mon, 07 Feb 2022 07:08:40 -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=An0HFihJ9ZTTSQ8BDo1S1Iek95nLk+9Ftksx3wwjOwIWO7HoCkeRBuCwh515kIZo8X zIA+G0k/U/Iv4kdBaQ01AprDFUOfR+OtNf6gJeMsQgisVkLlR3uqusuEAKLwhpyxIPiU KcN8jDsjvxmrsJEGkyolysszY4bt5260IsBRQ= 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=EYrmVv+YEJWSsO2n5qHpxfljitnxMep6HMS39pnazOwBdmZaH4fXQaEzyWNJ5LSd54 O68Dl/uA3isRf1tUXNi24srPwOAH0zbAAxkONR8JhxR8vdKIhYH8BThcvEWMTjdJ/NMs CAJOS2PFuKbcSc/tK/YatLmKAxxxGNi+qra6YNlj5AA2BQ0ImYgCBkYoVZYx2LwD7zUS Bep/8EbkpcdKA23vRgMRr+dgyMn3qyWSfE01HCT3tu0MoB0naSz2vo9JykKsIFfYWTiQ dNKhgM/pKSxO1JQQF4nYRkG7u00CZijg2TJD1L57T5g0oFwrZqV3qyfF8hAtPXyUurRe OCRA== X-Gm-Message-State: AOAM5317wblbSaAIflPuz1+Cak6IW1GVv+ZfsVD1OVB58IwQrd0yVr9t btkNziyFnAYgrXF5C2mmWM4pbA+Ewf1BHYrzrlMIZCaJ5bHS9T4Lleb4MR2OW4htS9om1L3fT1w mxdApU3BuE2Lp3Y3MqXxXN0jlosRUpSFxKqlmZYpWcdnSRblfFLuwPbybwKMHlnWK7tEq/BcdXS /nHUtDSEDQdpk3 X-Google-Smtp-Source: ABdhPJxWEyWAe3dqXYp9y0Osv9uym21zNkd+J9GpQLayDRLxah6bP1dpJfIrjXSh/xYh+t0S+Q6CtQtF59jY X-Received: by 2002:a17:902:ea0a:: with SMTP id s10mr34812plg.95.1644246520120; Mon, 07 Feb 2022 07:08:40 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id nn5sm271686pjb.6.2022.02.07.07.08.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Feb 2022 07:08:40 -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 57625605246B; Mon, 7 Feb 2022 10:08:39 -0500 (EST) From: ohilyard@iol.unh.edu To: ci@dpdk.org, alialnu@nvidia.com Cc: Owen Hilyard Subject: [PATCH v5 3/3] pw_maintainers_cli: fix crash caused by empty diff Date: Mon, 7 Feb 2022 10:08:26 -0500 Message-Id: <20220207150826.18950-3-ohilyard@iol.unh.edu> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220207150826.18950-1-ohilyard@iol.unh.edu> References: <20220207150826.18950-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