From patchwork Wed Nov 6 22:02:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Frey X-Patchwork-Id: 11231245 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 94C3A1747 for ; Wed, 6 Nov 2019 22:03:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 702342178F for ; Wed, 6 Nov 2019 22:03:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U23jb7Q2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726817AbfKFWDC (ORCPT ); Wed, 6 Nov 2019 17:03:02 -0500 Received: from mail-pf1-f171.google.com ([209.85.210.171]:34493 "EHLO mail-pf1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726779AbfKFWDB (ORCPT ); Wed, 6 Nov 2019 17:03:01 -0500 Received: by mail-pf1-f171.google.com with SMTP id n13so120719pff.1 for ; Wed, 06 Nov 2019 14:03:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4yuAbxyisaekvGok6uHnI+F0Eo7a/sIaAylawW0Slnk=; b=U23jb7Q2tFFuWs0vonfb95w7pcR0OJXVgAnMs7Njd9aJz6A5/LlqdhencrDiRSVqlT DeKYgFuNEZ0iRaD4iy++YFcRcPz6rHgTXc1De1upWIL6kLZxbRUQn73VekDuAlV11DVC yyJFxqBAhJ1KhbVAqMsxayJwSL1XtMG0YmVYRjhvt9toC/6UvkmJq9RWizpIyHkH1FNE FeAjvS1SnMPieR0iqdhjFc6QzlEhgXw0LuDN3bp1ZnAi8DIHQZrMC44HNvvZ8WyloXDf cyDtm9Jqc+iXccKkJ7Sg/FI7LA0YG3jsaK62Y5Jh3uiZbmYM3jVFNQ7ju+4q/3VVeAmK B2cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4yuAbxyisaekvGok6uHnI+F0Eo7a/sIaAylawW0Slnk=; b=dP992/A7K7RtS+ujcsaX7horeIuFBkPjd9k7JOwi4TX+jlHaKX4RAsg+VPbtjhZjSY K8G1+6ZK5e6Uqcwt6W7IkUAe3wcb/7zfN7UyvOxDdc09zmJfunONIWfUGURjNx/smx3Z u8L8/0dsPYB4EgXgjRQTBKdeYBagWRNzpTgosTPnWbExqjzJiu9Gd5YDUQPoA7M0zcjf L6vsDpDNNg+EG7s/YLN0Wnyv8eNrqFEcY5Tna2lQUQmStx2hv+KcjqEjSF1KMq2Fn8Yx Fhjm0Yvp1WOu67Fg1O4lLIZQiRQmEk9qi/B7lTQSIImTLForWjhNcUgBzT5Z8CCEaP7g jcaA== X-Gm-Message-State: APjAAAXwSK9blASfYwO9f3rwHLtl18tHl0o4VBgUnVSV685XtLHPPDmc bj/xAFUf6wCleRjlx/An0F/aXmcxB7y9og== X-Google-Smtp-Source: APXvYqxVSZIXCuSnKW+aUY9vNoYr461SmX5WGRRJpIqBnHJBJvNG3HO5tPyKy4sy2dngzWjUL0v9HA== X-Received: by 2002:a17:90a:9a81:: with SMTP id e1mr127952pjp.59.1573077780604; Wed, 06 Nov 2019 14:03:00 -0800 (PST) Received: from dfrey-arch-linux.local (carmd-fwm01.sierrawireless.com. [208.81.120.1]) by smtp.gmail.com with ESMTPSA id o15sm44915pgn.49.2019.11.06.14.02.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 14:02:59 -0800 (PST) From: David Frey To: backports@vger.kernel.org Cc: David Frey Subject: [PATCH] pycocci: fix error when python is python3 Date: Wed, 6 Nov 2019 14:02:48 -0800 Message-Id: <20191106220248.214650-1-dpfrey@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org When running under an Arch Linux system where python is python3, the following error was observed: Traceback (most recent call last): File "/home/dfrey/projects/backports-linux/devel/pycocci", line 172, in ret = _main() File "/home/dfrey/projects/backports-linux/devel/pycocci", line 158, in _main if args.jobs > 0: TypeError: '>' not supported between instances of 'NoneType' and 'int' The problem is that args.jobs is None in the case that the -j or --jobs argument wasn't passed to the command. In python3, an exception is generated when performing a comparison between different types. Signed-off-by: David Frey --- devel/pycocci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devel/pycocci b/devel/pycocci index 4aa1d363..eb072a7d 100755 --- a/devel/pycocci +++ b/devel/pycocci @@ -155,7 +155,7 @@ def _main(): if args.profile_cocci: extra_spatch_args.append('--profile') jobs = 0 - if args.jobs > 0: + if args.jobs is not None and args.jobs > 0: jobs = args.jobs output = threaded_spatch(args.cocci_file,