Server IP : 192.64.118.117 / Your IP : 3.15.190.49 Web Server : LiteSpeed System : Linux premium56.web-hosting.com 4.18.0-513.24.1.lve.1.el8.x86_64 #1 SMP Thu May 9 15:10:09 UTC 2024 x86_64 User : thecgapy ( 1160) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/urllib3/util/ |
Upload File : |
from __future__ import annotations import typing from types import TracebackType def to_bytes( x: str | bytes, encoding: str | None = None, errors: str | None = None ) -> bytes: if isinstance(x, bytes): return x elif not isinstance(x, str): raise TypeError(f"not expecting type {type(x).__name__}") if encoding or errors: return x.encode(encoding or "utf-8", errors=errors or "strict") return x.encode() def to_str( x: str | bytes, encoding: str | None = None, errors: str | None = None ) -> str: if isinstance(x, str): return x elif not isinstance(x, bytes): raise TypeError(f"not expecting type {type(x).__name__}") if encoding or errors: return x.decode(encoding or "utf-8", errors=errors or "strict") return x.decode() def reraise( tp: type[BaseException] | None, value: BaseException, tb: TracebackType | None = None, ) -> typing.NoReturn: try: if value.__traceback__ is not tb: raise value.with_traceback(tb) raise value finally: value = None # type: ignore[assignment] tb = None