| 3106 | self.multiline_block = False |
| 3107 | |
| 3108 | def _ensure_valid_message(self, msg): |
| 3109 | # Ensure the message conforms to our protocol. |
| 3110 | # If anything needs to be changed here for a patch release of Python, |
| 3111 | # the 'revision' in protocol_version() should be updated. |
| 3112 | match msg: |
| 3113 | case {"reply": str()}: |
| 3114 | # Send input typed by a user at a prompt to the remote PDB. |
| 3115 | pass |
| 3116 | case {"signal": "EOF"}: |
| 3117 | # Tell the remote PDB that the user pressed ^D at a prompt. |
| 3118 | pass |
| 3119 | case {"signal": "INT"}: |
| 3120 | # Tell the remote PDB that the user pressed ^C at a prompt. |
| 3121 | pass |
| 3122 | case { |
| 3123 | "complete": { |
| 3124 | "text": str(), |
| 3125 | "line": str(), |
| 3126 | "begidx": int(), |
| 3127 | "endidx": int(), |
| 3128 | } |
| 3129 | }: |
| 3130 | # Ask the remote PDB what completions are valid for the given |
| 3131 | # parameters, using readline's completion protocol. |
| 3132 | pass |
| 3133 | case _: |
| 3134 | raise AssertionError( |
| 3135 | f"PDB message doesn't follow the schema! {msg}" |
| 3136 | ) |
| 3137 | |
| 3138 | def _send(self, **kwargs): |
| 3139 | self._ensure_valid_message(kwargs) |