eric6/QScintilla/Exporters/ExporterHTML.py

changeset 8243
cc717c2ae956
parent 8205
4a0f1f896341
child 8259
2bbec88047dd
--- a/eric6/QScintilla/Exporters/ExporterHTML.py	Thu Apr 15 16:52:05 2021 +0200
+++ b/eric6/QScintilla/Exporters/ExporterHTML.py	Thu Apr 15 18:11:24 2021 +0200
@@ -13,6 +13,7 @@
 import os
 import sys
 import io
+import contextlib
 
 from PyQt5.QtGui import QFontInfo
 from PyQt5.QtWidgets import QInputDialog
@@ -578,7 +579,7 @@
         
         pyMdown = False
         if Preferences.getEditor("PreviewMarkdownUsePyMdownExtensions"):
-            try:
+            with contextlib.suppress(ImportError):
                 import pymdownx     # __IGNORE_EXCEPTION__ __IGNORE_WARNING__
                 # PyPI package is 'pymdown-extensions'
                 
@@ -589,8 +590,6 @@
                     'pymdownx.tasklist', 'pymdownx.smartsymbols',
                 ])
                 pyMdown = True
-            except ImportError:
-                pass
         
         if not pyMdown:
             extensions.extend(['extra', 'toc'])

eric ide

mercurial