Skip to content

Commit 42c21a6

Browse files
author
Алина
committed
import error
1 parent 92e2d57 commit 42c21a6

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

setup.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,12 @@
66

77
from setuptools import setup
88

9-
if sys.argv[-1] == 'publish':
9+
def get_long_description(f):
1010
try:
1111
import pypandoc
1212
except ImportError:
13-
print("pypandoc not installed.\nUse `pip install pypandoc`.\nExiting.")
14-
sys.exit(1)
15-
16-
def get_long_description(f):
17-
"""
18-
Converts md file to rst text
19-
"""
20-
try:
21-
return pypandoc.convert(f, 'rst')
22-
except NameError:
2313
return 'No description'
14+
return pypandoc.convert(f, 'rst')
2415

2516
install_requires = [
2617
'aiopg==0.10.0',
@@ -85,6 +76,11 @@ def get_package_data(package):
8576
version = get_version('tcrudge')
8677

8778
if sys.argv[-1] == 'publish':
79+
try:
80+
import pypandoc
81+
except ImportError:
82+
print("pypandoc not installed.\nUse `pip install pypandoc`.\nExiting.")
83+
sys.exit(1)
8884
pypandoc.download_pandoc()
8985
if os.system("pip freeze | grep twine"):
9086
print("twine not installed.\nUse `pip install twine`.\nExiting.")

0 commit comments

Comments
 (0)