From e1c63770f3be4b67572af20ce497c9c2dd0ad75a Mon Sep 17 00:00:00 2001 From: Jay Qi Date: Mon, 31 Jul 2023 11:34:32 -0400 Subject: [PATCH] Fix wrong comparison --- cloudpathlib/cloudpath.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)}" )