Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -106,9 +106,16 @@ def get_c_declarations(header=header, usedouble=False): · 105 unmodified lines | |||
| 106 | cpp_output = proc.stdout.read() | 106 | cpp_output = proc.stdout.read() |
| 107 | err_output = proc.stderr.read() | 107 | err_output = proc.stderr.read() |
| 108 | if err_output: | 108 | 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')) | ||
| 110 | if not cpp_output: | 111 | 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) | ||
| 112 | if not isinstance(cpp_output, list): | 119 | if not isinstance(cpp_output, list): |
| 113 | cpp_output = [l.strip() for l in cpp_output.decode('utf8').split('\n')] | 120 | cpp_output = [l.strip() for l in cpp_output.decode('utf8').split('\n')] |
| 114 | 121 | ||