asyncio-tkinter
asyncio-tkinter copied to clipboard
'Future' object has no attribute '_copy_state'
In either tkapp.py or tkapp2.py, clicking the "Count Words" or "Call with futures" button respectively (both of which use futures) gives the following error in Python 3.5:
exception calling callback for <Future at 0x10e9242b0 state=finished returned list>
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/concurrent/futures/_base.py", line 297, in _invoke_callbacks
callback(self)
File ".../asyncio-tkinter/guievents.py", line 43, in <lambda>
self.call_soon_threadsafe(new_future._copy_state, future))
AttributeError: 'Future' object has no attribute '_copy_state'
See here for how the (internal) API changed in Py3.5. Not sure why it's necessary to call an internal API function.
Annoying for sure, new code -> self.call_soon_threadsafe( futures._copy_future_state, future, new_future))
maybe yield from extracts you the right value