function
def _copying(self):
result = self.result.toPlainText().strip().split('\n')
to_copy = '\n'.join(result)
pyperclip.copy(to_copy)
in the MainWindow()
of my PyQt5 project raises an exception "StopIteration" in contextlib.py _GeneratorContextManager()
, line 119 'next(self.gen)'
.
result
is a ui.TextEdit
object. Could u please tell me what does it mean?
Google says i should wrap my func into with-construction, but i don't really inderstand how, and don't sure it's a good idea.
Debugger says:
__exception__ = {tuple} <class 'tuple'>: (<class 'StopIteration'>, StopIteration(), <traceback object at 0x045DA918>)
0 = {type} <class 'StopIteration'>
args = {getset_descriptor} <attribute 'args' of 'BaseException' objects>
value = {member_descriptor} <member 'value' of 'StopIteration' objects>
1 = {StopIteration}
args = {tuple} <class 'tuple'>: ()
value = {NoneType} None
2 = {traceback} <traceback object at 0x045DA918>
tb_frame = {frame} __exit__ [contextlib.py:119] id:54111736
tb_lasti = {int} 16
tb_lineno = {int} 119
tb_next = {NoneType} None
__len__ = {int} 3
Console says nothing. But the project is crashing.