(exc: Exception)
| 256 | |
| 257 | |
| 258 | def unwrap_context(exc: Exception) -> Optional[Exception]: |
| 259 | context = exc.__context__ |
| 260 | if isinstance(context, Exception): |
| 261 | return unwrap_context(context) |
| 262 | else: |
| 263 | return exc |
| 264 | |
| 265 | |
| 266 | def url_as_host(url: str) -> str: |