Repository: neurobin/mdx_include (language: python)

Issue:
python-markdown's `version_info` is deprecated
`version_info` attribute of python-markdown has been deprecated via:
https://github.com/Python-Markdown/markdown/commit/a767b2daaad78ba32d45a4f1dabb7c5e218f030a

There are several lines in this repository that access that attribute, and this module does not work with python-markdown 3.4.


Discussion / hints:

Fix patch:
diff --git a/mdx_include/mdx_include.py b/mdx_include/mdx_include.py
index d09af5b..bc807e8 100644
--- a/mdx_include/mdx_include.py
+++ b/mdx_include/mdx_include.py
@@ -39,7 +39,7 @@
 
 __version__ = version.__version__
 
-MARKDOWN_MAJOR = markdown.version_info[0]
+MARKDOWN_MAJOR = (markdown.__version_info__ if hasattr(markdown, "__version_info__") else markdown.version_info)[0]
 
 logging.basicConfig()
 LOGGER_NAME = 'mdx_include-' + __version__


Test patch:
diff --git a/mdx_include/test/test.py b/mdx_include/test/test.py
index f113ff6..bf0de2c 100644
--- a/mdx_include/test/test.py
+++ b/mdx_include/test/test.py
@@ -22,7 +22,7 @@ def get_file_content(path):
     return cont
 
 def assertEqual(self, html, output):
-    if tuple(markdown.version_info) >= (3, 3):
+    if tuple(markdown.__version_info__ if hasattr(markdown, "__version_info__") else markdown.version_info) >= (3, 3):
         html = html.replace('ass="language-', 'ass="')
         html = html.replace('\n\n<p>', '<p>')
         html = html.replace('\n<p>', '<p>')