--- a/eric6/WebBrowser/Bookmarks/BookmarksImporters/HtmlImporter.py Thu Apr 08 17:27:12 2021 +0200 +++ b/eric6/WebBrowser/Bookmarks/BookmarksImporters/HtmlImporter.py Thu Apr 08 18:27:47 2021 +0200 @@ -27,26 +27,26 @@ (string) @exception ValueError raised to indicate an invalid browser ID """ - if sourceId == "html": - return ( - UI.PixmapCache.getPixmap("html"), - "HTML Netscape Bookmarks", - QCoreApplication.translate( - "HtmlImporter", - "HTML Netscape Bookmarks") + " (*.htm *.html)", - QCoreApplication.translate( - "HtmlImporter", - """You can import bookmarks from any browser that supports""" - """ HTML exporting. This file has usually the extension""" - """ .htm or .html."""), - QCoreApplication.translate( - "HtmlImporter", - """Please choose the file to begin importing bookmarks."""), - "", - ) - else: + if sourceId != "html": raise ValueError( "Unsupported browser ID given ({0}).".format(sourceId)) + + return ( + UI.PixmapCache.getPixmap("html"), + "HTML Netscape Bookmarks", + QCoreApplication.translate( + "HtmlImporter", + "HTML Netscape Bookmarks") + " (*.htm *.html)", + QCoreApplication.translate( + "HtmlImporter", + """You can import bookmarks from any browser that supports""" + """ HTML exporting. This file has usually the extension""" + """ .htm or .html."""), + QCoreApplication.translate( + "HtmlImporter", + """Please choose the file to begin importing bookmarks."""), + "", + ) class HtmlImporter(BookmarksImporter):