From cac4b807f8e6b5a6c22a7154a747de0c99a94e20 Mon Sep 17 00:00:00 2001 From: Jerome Kieffer Date: Thu, 19 Dec 2024 18:13:19 +0100 Subject: [PATCH] a couple of stupid bugs --- src/pyFAI/io/integration_config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pyFAI/io/integration_config.py b/src/pyFAI/io/integration_config.py index 85b24ba05..5506d6030 100644 --- a/src/pyFAI/io/integration_config.py +++ b/src/pyFAI/io/integration_config.py @@ -35,6 +35,7 @@ __docformat__ = 'restructuredtext' import logging +import copy from dataclasses import dataclass, fields from typing import ClassVar from . import ponifile @@ -372,7 +373,7 @@ def from_dict(cls, dico, consume=False): "Alternative constructor, accepts everything which is in OPTIONAL" if consume: dico = copy.copy(dico) - to_init = {field.name:dict.pop(field.name) for field in dataclasses.fields(cls) if field.name in dict} + to_init = {field.name:dict.pop(field.name) for field in fields(cls) if field.name in dict} self = cls(to_init) for key in cls.OPTIONAL: if key in dico: