src/eric7/Project/LexerAssociationDialog.py

branch
eric7
changeset 9482
a2bc06a54d9d
parent 9473
3f23dbf37dbe
child 9514
2b104ad132a4
--- 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)
 

eric ide

mercurial