diff -r 0b936ff1bbb9 -r a2bc06a54d9d src/eric7/Project/LexerAssociationDialog.py --- a/src/eric7/Project/LexerAssociationDialog.py Sun Nov 06 11:22:39 2022 +0100 +++ b/src/eric7/Project/LexerAssociationDialog.py Mon Nov 07 17:19:58 2022 +0100 @@ -9,6 +9,7 @@ import os +from pygments.lexers import get_all_lexers from PyQt6.QtCore import Qt, pyqtSlot from PyQt6.QtWidgets import QDialog, QHeaderView, QTreeWidgetItem @@ -40,11 +41,7 @@ header.setSectionResizeMode(QHeaderView.ResizeMode.ResizeToContents) header.setSortIndicator(0, Qt.SortOrder.AscendingOrder) - try: - self.extsep = os.extsep - except AttributeError: - self.extsep = "." - + self.extsep = os.extsep self.extras = ["-----------", self.tr("Alternative")] self.editorLexerCombo.addItem("") @@ -53,8 +50,6 @@ self.editorLexerCombo.addItem(Lexers.getLanguageIcon(lang, False), lang) self.editorLexerCombo.addItems(self.extras) - from pygments.lexers import get_all_lexers - pygmentsLexers = [""] + sorted(lex[0] for lex in get_all_lexers()) self.pygmentsLexerCombo.addItems(pygmentsLexers)