diff -r d38295fd97c2 -r a967ff16629a PluginRefactoringRope.py --- a/PluginRefactoringRope.py Sat Mar 27 09:48:05 2021 +0100 +++ b/PluginRefactoringRope.py Sat Apr 24 11:19:08 2021 +0200 @@ -8,6 +8,7 @@ """ import os +import contextlib from PyQt5.QtCore import Qt, QObject, QTranslator, QCoreApplication @@ -21,7 +22,7 @@ author = "Detlev Offenbach <detlev@die-offenbachs.de>" autoactivate = True deactivateable = True -version = "7.3.2" +version = "7.4.0" className = "RefactoringRopePlugin" packageName = "RefactoringRope" internalPackages = "rope" @@ -101,10 +102,7 @@ palette = e5App().palette() lightness = palette.color(QPalette.Window).lightness() usesDarkPalette = lightness <= 128 - if usesDarkPalette: - iconSuffix = "dark" - else: - iconSuffix = "light" + iconSuffix = "dark" if usesDarkPalette else "light" data = { "ropeAutoCompletionPage": [ @@ -366,12 +364,9 @@ @param editor reference to the editor @type QScintilla.Editor.Editor """ - try: + with contextlib.suppress(TypeError): editor.editorAboutToBeSaved.disconnect(self.__editorAboutToBeSaved) editor.editorSaved.disconnect(self.__editorSaved) - except TypeError: - # just ignore it - pass self.__unsetAutoCompletionHook(editor) self.__unsetCalltipsHook(editor)