(tool, argv, filename, stderr, rc)
| 119 | |
| 120 | |
| 121 | def convert_error(tool, argv, filename, stderr, rc): |
| 122 | error = (stderr.splitlines()[0], rc) |
| 123 | if (_expected := is_os_mismatch(filename, stderr)): |
| 124 | logger.info(stderr.strip()) |
| 125 | raise OSMismatchError(filename, _expected, argv, error, tool) |
| 126 | elif (_missing := is_missing_dep(stderr)): |
| 127 | logger.info(stderr.strip()) |
| 128 | raise MissingDependenciesError(filename, (_missing,), argv, error, tool) |
| 129 | elif '#error' in stderr: |
| 130 | # XXX Ignore incompatible files. |
| 131 | error = (stderr.splitlines()[1], rc) |
| 132 | logger.info(stderr.strip()) |
| 133 | raise ErrorDirectiveError(filename, argv, error, tool) |
| 134 | else: |
| 135 | # Try one more time, with stderr written to the terminal. |
| 136 | try: |
| 137 | output = run_cmd(argv, stderr=None) |
| 138 | except subprocess.CalledProcessError: |
| 139 | raise PreprocessorFailure(filename, argv, error, tool) |
| 140 | |
| 141 | |
| 142 | def is_os_mismatch(filename, errtext=None): |
no test coverage detected
searching dependent graphs…