diff --git a/src/calibre/gui2/tweak_book/editor/widget.py b/src/calibre/gui2/tweak_book/editor/widget.py index 14ed922bed..3a222523dd 100644 --- a/src/calibre/gui2/tweak_book/editor/widget.py +++ b/src/calibre/gui2/tweak_book/editor/widget.py @@ -210,6 +210,7 @@ class Editor(QMainWindow): return False def launch_editor(path_to_edit, path_is_raw=False, syntax='html'): + app = QApplication([]) if path_is_raw: raw = path_to_edit else: @@ -220,7 +221,6 @@ def launch_editor(path_to_edit, path_is_raw=False, syntax='html'): syntax = 'html' elif ext in ('css',): syntax = 'css' - app = QApplication([]) t = Editor(syntax) t.data = raw t.show()