aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'markdown/__init__.py')
-rw-r--r--markdown/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/markdown/__init__.py b/markdown/__init__.py
index cbcee58..fdfe8b8 100644
--- a/markdown/__init__.py
+++ b/markdown/__init__.py
@@ -221,6 +221,10 @@ class Markdown(object):
# Assume string uses dot syntax (`path.to.some.module`)
module = importlib.import_module(ext_name)
logger.debug('Successfuly imported extension module "%s".' % ext_name)
+ # For backward compat (until deprecation) check that this is an extension
+ if '.' not in ext_name and not (hasattr(module, 'extendMarkdown') or (class_name and hasattr(module, class_name))):
+ # We have a name conflict (eg: extensions=['tables'] and PyTables is installed)
+ raise ImportError
except ImportError:
# Preppend `markdown.extensions.` to name
module_name = '.'.join(['markdown.extensions', ext_name])