diff options
-rwxr-xr-x | syntax-highlighting-server.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/syntax-highlighting-server.py b/syntax-highlighting-server.py index d650664..6a13393 100755 --- a/syntax-highlighting-server.py +++ b/syntax-highlighting-server.py @@ -74,11 +74,14 @@ def main(): else: workers = args.workers - with ProcessPoolExecutor(max_workers=workers) as pool: - gc.collect() - gc.freeze() - pool.map(noop, [None] * workers) - run(args, pool) + if workers == 1: + run(args) + else: + with ProcessPoolExecutor(max_workers=workers) as pool: + gc.collect() + gc.freeze() + pool.map(noop, [None] * workers) + run(args, pool) if __name__ == '__main__': main() |