function
def _copying(self):
result = self.result.toPlainText().strip().split('\n')
to_copy = '\n'.join(result)
pyperclip.copy(to_copy)
в MainWindow()
моего проекта PyQt5 вызывает исключение "StopIteration" в contextlib.py _GeneratorContextManager()
, line 119 'next(self.gen)'
.result
является ui.TextEdit
объектом.Не могли бы вы сказать мне, что это значит?Google говорит, что я должен обернуть свою функцию в конструкцию, но я не совсем понимаю, как, и не уверен, что это хорошая идея.
Отладчик говорит:
__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
Консольничего не говоритНо проект рушится.