mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-30 18:09:59 +03:00
Adjust Markdown Version Checks to Avoid Warning
This commit is contained in:
parent
29cbe574a3
commit
68c3b4508a
|
@ -184,10 +184,12 @@ if 'patch' not in View.http_method_names:
|
|||
try:
|
||||
import markdown
|
||||
|
||||
if markdown.version <= '2.2':
|
||||
if not hasattr(markdown, '__version__') and markdown.version <= '2.2':
|
||||
HEADERID_EXT_PATH = 'headerid'
|
||||
LEVEL_PARAM = 'level'
|
||||
elif markdown.version < '2.6':
|
||||
elif not hasattr(markdown, '__version__') or (
|
||||
type(markdown.__version__) != type('') and markdown.version < '2.6'
|
||||
):
|
||||
HEADERID_EXT_PATH = 'markdown.extensions.headerid'
|
||||
LEVEL_PARAM = 'level'
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user