Skip to content

Commit

Permalink
a couple of stupid bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
kif committed Dec 19, 2024
1 parent 1f6a889 commit cac4b80
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pyFAI/io/integration_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
__docformat__ = 'restructuredtext'

import logging
import copy
from dataclasses import dataclass, fields
from typing import ClassVar
from . import ponifile
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit cac4b80

Please sign in to comment.