线程池python多处理错误
在python中使用ThreadPool时出现以下错误,我不确定发生了什么线程池python多处理错误,python,threadpool,python-multithreading,Python,Threadpool,Python Multithreading,在python中使用ThreadPool时出现以下错误,我不确定发生了什么 Traceback (most recent call last): File "bot.py", line 365, in <module> results=pool.map(my_func,my_list) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessi
Traceback (most recent call last):
File "bot.py", line 365, in <module>
results=pool.map(my_func,my_list)
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/pool.py", line 251, in map
return self.map_async(func, iterable, chunksize).get()
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multipro
cessing/pool.py", line 569, in get
raise self._value
TypeError: range() integer end argument expected, got float.
我甚至访问了/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multipro
cessing/pool.py文件,并对其进行编辑以获取更多信息。我在那里放了一些指纹:
def get(self, timeout=None):
self.wait(timeout)
if not self._ready:
raise TimeoutError
print self._ready
print self._success
print self._value
if self._success:
return self._value
else:
raise self._value
这就是我得到的:
True
False
range() integer end argument expected, got float.
那么,我做错什么了吗?这是多线程库的问题吗?: 好的,我发现了问题。这不是因为线程,而是因为my_func中的某些东西返回了错误,系统认为这是线程的问题。
True
False
range() integer end argument expected, got float.