From 4a52a71956a8d46fcb7294ac71734504bb09bcc2 Mon Sep 17 00:00:00 2001 From: S. Solomon Darnell Date: Fri, 28 Mar 2025 21:52:21 -0500 Subject: two version of R2R are here --- .venv/lib/python3.12/site-packages/PIL/_util.py | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .venv/lib/python3.12/site-packages/PIL/_util.py (limited to '.venv/lib/python3.12/site-packages/PIL/_util.py') diff --git a/.venv/lib/python3.12/site-packages/PIL/_util.py b/.venv/lib/python3.12/site-packages/PIL/_util.py new file mode 100644 index 00000000..8ef0d36f --- /dev/null +++ b/.venv/lib/python3.12/site-packages/PIL/_util.py @@ -0,0 +1,26 @@ +from __future__ import annotations + +import os +from typing import Any, NoReturn + +from ._typing import StrOrBytesPath, TypeGuard + + +def is_path(f: Any) -> TypeGuard[StrOrBytesPath]: + return isinstance(f, (bytes, str, os.PathLike)) + + +class DeferredError: + def __init__(self, ex: BaseException): + self.ex = ex + + def __getattr__(self, elt: str) -> NoReturn: + raise self.ex + + @staticmethod + def new(ex: BaseException) -> Any: + """ + Creates an object that raises the wrapped exception ``ex`` when used, + and casts it to :py:obj:`~typing.Any` type. + """ + return DeferredError(ex) -- cgit v1.2.3