Skip to content

Commit

Permalink
upath.implementations.local: suppress warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-- committed Mar 3, 2024
1 parent ec0645f commit b6fa0c0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion upath/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,10 @@ def __init_subclass__(cls, **kwargs):
"""provide a clean migration path for custom user subclasses"""

# Check if the user subclass has a custom `__new__` method
has_custom_new_method = cls.__new__ is not UPath.__new__
has_custom_new_method = (
cls.__new__ is not UPath.__new__
and cls.__name__ not in {"PosixUPath", "WindowsUPath"}
)

if has_custom_new_method and cls._protocol_dispatch is None:
warnings.warn(
Expand Down

0 comments on commit b6fa0c0

Please sign in to comment.