Commit 31bd8253 authored by Jan Kiene's avatar Jan Kiene
Browse files

default to None for numof threads

parent 63238a20
Loading
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -73,7 +73,12 @@ def main(args):
        print(f"Comparing {len(common_files)} files...")

        outputs = dict()
        if args.num_threads > 1:
        if args.num_threads == 1:
            # if only one thread is passed, do everything in the main thread
            # to allow for meaningful debugging if needed
            for f in common_files:
                compare_files(f, fol1, fol2, outputs, tool)
        else:
            with concurrent.futures.ThreadPoolExecutor(
                max_workers=args.num_threads
            ) as exc:
@@ -85,11 +90,6 @@ def main(args):
                    repeat(outputs),
                    repeat(tool),
                )
        else:
            # if only one thread is passed, do everything in the main thread
            # to allow for meaningful debugging if needed
            for f in common_files:
                compare_files(f, fol1, fol2, outputs, tool)

        if args.sort:
            out = dict(sorted(outputs.items(), key=lambda item: item[1]))
@@ -280,7 +280,7 @@ if __name__ == "__main__":
        help="If given, write output diffs to this file as comma-separated values (csv)",
    )
    parser.add_argument(
        "-t", "--num_threads", type=int, default=1, help="Number of threads to use"
        "-t", "--num_threads", type=int, default=None, help="Number of threads to use"
    )
    parser.add_argument(
        "--tool",