diff --git a/changes/339.fixed b/changes/339.fixed new file mode 100644 index 00000000..2fa50ce7 --- /dev/null +++ b/changes/339.fixed @@ -0,0 +1 @@ +Fixed bug with deepcopy in dunder new. diff --git a/diffsync/__init__.py b/diffsync/__init__.py index c48e7053..402320ea 100644 --- a/diffsync/__init__.py +++ b/diffsync/__init__.py @@ -488,7 +488,7 @@ def __new__(cls, **kwargs): # type: ignore[no-untyped-def] for key, value in kwargs.items(): try: meta_kwargs[key] = deepcopy(value) - except (TypeError, AttributeError): + except Exception: # pylint: disable=broad-exception-caught # Some objects (e.g. Kafka Consumer, DB connections) cannot be deep copied meta_kwargs[key] = value instance = super().__new__(cls)