Skip to content

Commit fe09ac0

Browse files
[NFC][update-checkout] remove usage of the multiprocessing module
1 parent 1885c9b commit fe09ac0

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

utils/update_checkout/update_checkout/parallel_runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
from multiprocessing import cpu_count
2+
import os
33
import time
44
from typing import Callable, List, Any, Optional, Tuple, Union
55
from threading import Lock, Thread, Event
@@ -91,7 +91,7 @@ def run_safely(*args, **kwargs):
9191
if n_threads == 0:
9292
# Limit the number of threads as the performance regresses if the
9393
# number is too high.
94-
n_threads = min(cpu_count() * 2, 16)
94+
n_threads = min(os.cpu_count() * 2, 16)
9595
self._n_threads = n_threads
9696
self._monitor_polling_period = 0.1
9797
self._terminal_width = shutil.get_terminal_size().columns

utils/update_checkout/update_checkout/update_checkout.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import re
1616
import sys
1717
import traceback
18-
from multiprocessing import freeze_support
1918
from typing import Any, Dict, Hashable, Optional, Set, List, Tuple, Union
2019

2120
from .cli_arguments import CliArguments
@@ -768,7 +767,6 @@ def skip_list_for_platform(config: Dict[str, Any], all_repos: bool) -> List[str]
768767

769768

770769
def main() -> int:
771-
freeze_support()
772770
args = CliArguments.parse_args()
773771

774772
if not args.scheme:

0 commit comments

Comments
 (0)