Skip to content

Commit dd46bd6

Browse files
committed
Fix issues with the importation and usage of pypandoc
1 parent bc75f50 commit dd46bd6

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

setup.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@
3737
from re import compile as comp
3838
from unittest import TestLoader
3939

40-
from pypandoc import convert
40+
try:
41+
from pypandoc import convert
42+
except (IOError, ImportError): # pragma: no cover
43+
pass
44+
4145
from setuptools import setup
4246

4347

@@ -82,7 +86,10 @@ def _get_long_description():
8286
This function return the long description.
8387
"""
8488

85-
return convert("README.md", "rst")
89+
try:
90+
return convert("README.md", "rst")
91+
except NameError: # pragma: no cover
92+
return open("README.md", encoding="utf-8").read() # pragma: no cover
8693

8794

8895
setup(

0 commit comments

Comments
 (0)