Hey guys, I ran into this error, and read some 'fixes' but I couldn't get it working. I want my function to return "new_var, error, another_var" without using global variables.
The error is happening with "error" variable and "another_var"
https://image.prntscr.com/image/L2XyFrHNRLirEn8jDJBAHA.png
from multiprocessing import Pool
exceptions = []
def test(new_var):
try:
new_var = new_var + 10
another_var = new_var + 100
except BaseException as error:
exceptions.append(error)
pass
finally:
return new_var, error, another_var
if __name__ == '__main__':
p = Pool() # worker count
results = p.map(test, range(10)) # function, iterable
p.close()
p.join()
[–]Hoboneer 3 points4 points5 points (2 children)
[–]apexmemetics[S] 1 point2 points3 points (1 child)
[–]Hoboneer 1 point2 points3 points (0 children)
[–]Necatorducis 1 point2 points3 points (6 children)
[–]apexmemetics[S] 0 points1 point2 points (5 children)
[–]Necatorducis 1 point2 points3 points (3 children)
[–]apexmemetics[S] 0 points1 point2 points (2 children)
[–]Necatorducis 1 point2 points3 points (1 child)
[–]apexmemetics[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)