Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions upath/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,18 @@ class _IncompatibleProtocolError(TypeError, ValueError):
"""switch to TypeError for incompatible protocols in a backward compatible way.

!!! Do not use this exception directly !!!
Catch TypeError instead, if you need to handle incompatible protocol errors.

We'll do the switch in a future major release.
"""

# evil: make this look like a built-in TypeError
__module__ = "builtins"
__qualname__ = "TypeError"

def __repr__(self) -> str:
return f"TypeError({', '.join(map(repr, self.args))})"


class _UPathMeta(ABCMeta):
"""metaclass for UPath to customize instance creation
Expand Down