From 3f5c74d62357853f3f4b6d08f534ba92207df2dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Pr=C3=B6pper?= Date: Wed, 3 Sep 2014 13:40:58 +0200 Subject: [PATCH] Fix: Do not use deprecated keyword in setup_editor for spyderlib >= 2.3.0 --- spykeviewer/ui/plugin_editor_dock.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/spykeviewer/ui/plugin_editor_dock.py b/spykeviewer/ui/plugin_editor_dock.py index ca45a1c..a7e9ce5 100644 --- a/spykeviewer/ui/plugin_editor_dock.py +++ b/spykeviewer/ui/plugin_editor_dock.py @@ -111,12 +111,22 @@ def _setup_editor(self): font = QFont('Some font that does not exist') font.setStyleHint(font.TypeWriter, font.PreferDefault) editor = codeeditor.CodeEditor(self) - editor.setup_editor( - linenumbers=True, language='py', - scrollflagarea=False, codecompletion_enter=self.enter_completion, - tab_mode=False, edge_line=False, font=font, - codecompletion_auto=True, go_to_definition=True, - codecompletion_single=True, calltips=True) + try: + editor.setup_editor( + linenumbers=True, language='py', + scrollflagarea=False, + codecompletion_enter=self.enter_completion, + tab_mode=False, edge_line=False, font=font, + codecompletion_auto=True, go_to_definition=True, + codecompletion_single=True, calltips=True) + except TypeError: # codecompletion_single is gone in 2.3.0 + editor.setup_editor( + linenumbers=True, language='py', + scrollflagarea=False, + codecompletion_enter=self.enter_completion, + tab_mode=False, edge_line=False, font=font, + codecompletion_auto=True, go_to_definition=True, + calltips=True) editor.setCursor(Qt.IBeamCursor) editor.horizontalScrollBar().setCursor(Qt.ArrowCursor) editor.verticalScrollBar().setCursor(Qt.ArrowCursor)