Author: Andreas Tille <tille@debian.org>
Last-Update: Mon, 05 Aug 2019 10:03:14 +0200
Description: Run 2to3 on Python2 files to try a Python3 port

--- a/configure.py
+++ b/configure.py
@@ -1,11 +1,11 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 """Configure the build.
 
 - Fetch boost/gtest.
 - Create defines.mk
 """
 import argparse
-import commands
+import subprocess
 import contextlib
 import os
 import sys
@@ -18,7 +18,7 @@ def log(msg):
 
 def shell(cmd):
     log(cmd)
-    status, output = commands.getstatusoutput(cmd)
+    status, output = subprocess.getstatusoutput(cmd)
     if status:
         raise Exception('%d <-| %r' %(status, cmd))
     return output
@@ -178,7 +178,7 @@ def get_make_style_env(envin, args):
     return envout
 
 class OsType:
-    Unknown, Linux, Darwin = range(3)
+    Unknown, Linux, Darwin = list(range(3))
 
 def getOsType():
     uname = shell('uname -s')
--- a/src/filterm4.py
+++ b/src/filterm4.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Filters for unique, highest scoring subread query/target pairs from an m4
 # file. Helps get rid of chimeras, at the cost of some yield.
@@ -35,7 +35,7 @@ def printUniq(qgroup, count):
         else:
             top[k] = q
 
-    for r in top.values():
+    for r in list(top.values()):
         count.filt += 1
         print(r, end=' ')
 
--- a/src/m4topre.py
+++ b/src/m4topre.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 """Super-simple converter from blasr m4 alignments to pbdagcon 'pre'
 alignments. For use in the pre-assembler dagcon workflow.
 """
@@ -7,7 +7,7 @@ from __future__ import print_function
 import sys
 import heapq
 import string # pylint: disable=W0402
-from itertools import ifilter
+
 from collections import namedtuple, defaultdict
 import numpy as np
 from pbcore.io.FastaIO import FastaReader
@@ -169,7 +169,7 @@ def main(): # pylint: disable=R0914
 
     # take a max number of alignments for each target
     limiter = AlnLimiter()
-    my_m4recs[:] = [x for x in ifilter(limiter, my_m4recs)]
+    my_m4recs[:] = [x for x in filter(limiter, my_m4recs)]
 
     # load only related sequences
     seqs = {}
