diff --git a/cloudpathlib/cloudpath.py b/cloudpathlib/cloudpath.py index 8fede295..401f9775 100644 --- a/cloudpathlib/cloudpath.py +++ b/cloudpathlib/cloudpath.py @@ -559,7 +559,7 @@ def _patched_close_empty_cache(*args, **kwargs): return buffer def replace(self, target: Self) -> Self: - if type(self) is type(target): + if type(self) is not type(target): raise TypeError( f"The target based to rename must be an instantiated class of type: {type(self)}" )