Backports Archive on
 help / color / Atom feed
From: David Frey <>
Cc: David Frey <>
Subject: [PATCH] pycocci: fix error when python is python3
Date: Wed,  6 Nov 2019 14:02:48 -0800
Message-ID: <> (raw)

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 <module>
      ret = _main()
    File "/home/dfrey/projects/backports-linux/devel/pycocci", line 158, in _main
      if > 0:
  TypeError: '>' not supported between instances of 'NoneType' and 'int'

The problem is that 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:
     jobs = 0
-    if > 0:
+    if is not None and > 0:
         jobs =
     output = threaded_spatch(args.cocci_file,

To unsubscribe from this list: send the line "unsubscribe backports" in

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Backports Archive on

Archives are clonable:
	git clone --mirror backports/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 backports backports/ \
	public-inbox-index backports

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone