History

python/lib/gen_external.py: verbose compiler warnings

Paul Brossier committed 8 years ago

Commit 073b9691 parent 31742b81 file · +9 −2Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/lib/gen_external.py+9−2
@@ -106,9 +106,16 @@ def get_c_declarations(header=header, usedouble=False): · 105 unmodified lines
106106 cpp_output = proc.stdout.read()
107107 err_output = proc.stderr.read()
108108 if err_output:
109− print("Warning: preprocessor produced errors or warnings:\n%s" % err_output)
109+ print("Warning: preprocessor produced errors or warnings:\n%s" \
110+ % err_output.decode('utf8'))
110111 if not cpp_output:
111− raise Exception("preprocessor output is empty:\n%s" % err_output)
112+ raise_msg = "preprocessor output is empty! Running command " \
113+ + "\"%s\" failed" % " ".join(cpp_cmd)
114+ if err_output:
115+ raise_msg += " with stderr: \"%s\"" % err_output.decode('utf8')
116+ else:
117+ raise_msg += " with no stdout or stderr"
118+ raise Exception(raise_msg)
112119 if not isinstance(cpp_output, list):
113120 cpp_output = [l.strip() for l in cpp_output.decode('utf8').split('\n')]
114121

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t