Skip to content

Commit b584ca3

Browse files
WGHzachriggle
WGH
authored andcommitted
fixed RuntimeError in setup.py caused by pandoc on non-amd64 arches (#820)
If pandoc is not installed locally, pwntools' setup.py tells pypandoc to download one. Unfortunately, it fails on non-amd64 arches because pypandocs provides precompiled binaries only for amd64. Since pypandoc is not hard dependency for pwntools, this error can be skipped without major harm. In fact, pwntools' setup.py already handles ImportError gracefully. The problem is, arch mismatch causes a completely different exception.
1 parent 8b30700 commit b584ca3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

setup.py

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
import platform
55
import sys
6+
import traceback
67
from distutils.command.install import INSTALL_SCHEMES
78
from distutils.sysconfig import get_python_inc
89
from distutils.util import convert_path
@@ -75,6 +76,9 @@
7576
long_description = pypandoc.convert_file('README.md', 'rst')
7677
except ImportError:
7778
pass
79+
except Exception as e:
80+
print >>sys.stderr, "Failed to convert README.md through pandoc, proceeding anyway"
81+
traceback.print_exc()
7882

7983

8084
setup(

0 commit comments

Comments
 (0)