(self)
| 3564 | type_state.update_protocol_deps(deps) |
| 3565 | |
| 3566 | def suppressed_deps_opts(self) -> bytes: |
| 3567 | if not self.suppressed: |
| 3568 | return b"" |
| 3569 | if self.known_suppressed_deps_opts: |
| 3570 | return self.known_suppressed_deps_opts |
| 3571 | buf = WriteBuffer() |
| 3572 | import_options = self.manager.import_options |
| 3573 | for dep in sorted(self.suppressed): |
| 3574 | # Using .get() is a bit defensive, but just in case we have a bug elsewhere |
| 3575 | # (e.g. in the daemon), it is better to get a stale cache than a crash. |
| 3576 | reason = self.manager.missing_modules.get(dep, SuppressionReason.NOT_FOUND) |
| 3577 | if self.priorities.get(dep) != PRI_INDIRECT: |
| 3578 | write_str_bare(buf, dep) |
| 3579 | write_bytes_bare(buf, import_options[dep]) |
| 3580 | write_int_bare(buf, reason) |
| 3581 | return buf.getvalue() |
| 3582 | |
| 3583 | def write_cache(self) -> tuple[CacheMeta, str] | None: |
| 3584 | assert self.tree is not None, "Internal error: method must be called on parsed file only" |
no test coverage detected