Skip to content

Commit d86fa63

Browse files
committed
FIX: Remove multiprocessing from find_multiple due to pickling issues.
1 parent 32c6b1e commit d86fa63

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

botcity/web/bot.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import io
55
import json
66
import logging
7-
import multiprocessing
87
import os
98
import platform
109
import random
@@ -405,7 +404,6 @@ def _to_dict(lbs, elems):
405404
print('Warning: Ignoring best=False for now. It will be supported in the future.')
406405

407406
start_time = time.time()
408-
n_cpus = multiprocessing.cpu_count() - 1
409407

410408
while True:
411409
elapsed_time = (time.time() - start_time) * 1000
@@ -415,8 +413,7 @@ def _to_dict(lbs, elems):
415413
haystack = self.screenshot()
416414
helper = functools.partial(self._find_multiple_helper, haystack, region, matching, grayscale)
417415

418-
with multiprocessing.Pool(processes=n_cpus) as pool:
419-
results = pool.map(helper, paths)
416+
results = [helper(p) for p in paths]
420417

421418
results = [r for r in results]
422419
if None in results:

0 commit comments

Comments
 (0)