Skip to content

Commit 7365336

Browse files
committed
Allow installation on Windows.
Installation on Windows was failing because the which command doesn't exist. pyandoc now finds the pandoc executable internally anyways so this was redundant. Signed-off-by: Corey Kline <Corey.Kline@digi.com>
1 parent 3ffa60b commit 7365336

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

setup.py

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,15 @@ def get_long_description():
2828
try:
2929
import subprocess
3030
import pandoc
31-
32-
process = subprocess.Popen(
33-
['which pandoc'],
34-
shell=True,
35-
stdout=subprocess.PIPE,
36-
universal_newlines=True)
37-
38-
pandoc_path = process.communicate()[0]
39-
pandoc_path = pandoc_path.strip('\n')
40-
41-
pandoc.core.PANDOC_PATH = pandoc_path
42-
31+
print(pandoc.core.PANDOC_PATH)
4332
doc = pandoc.Document()
44-
doc.markdown = long_description
45-
long_description = doc.rst
46-
open("README.rst", "w").write(doc.rst)
33+
doc.markdown = long_description.encode('utf-8')
34+
long_description = doc.rst.decode()
35+
open("README.rst", "wb").write(doc.rst)
36+
4737
except:
48-
if os.path.exists("README.rst"):
49-
long_description = open("README.rst").read()
50-
else:
51-
print("Could not find pandoc or convert properly")
52-
print(" make sure you have pandoc (system) and pyandoc (python module) installed")
38+
print("Could not find pandoc or convert properly")
39+
print(" make sure you have pandoc (system) and pyandoc (python module) installed")
5340

5441
return long_description
5542

0 commit comments

Comments
 (0)