Backports Archive on
 help / color / Atom feed
* [PATCH] pycocci: fix error when python is python3
@ 2019-11-06 22:02 David Frey
  0 siblings, 0 replies; only message in thread
From: David Frey @ 2019-11-06 22:02 UTC (permalink / raw)
  To: backports; +Cc: David Frey

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06 22:02 [PATCH] pycocci: fix error when python is python3 David Frey

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