Skip to content

Commit

Permalink
Merge pull request #201 from caracal-pipeline/python311compat
Browse files Browse the repository at this point in the history
Minor changes for compatibility with Python 3.11.
  • Loading branch information
o-smirnov authored Jan 29, 2024
2 parents 1d8c0d2 + e3d63e0 commit 143f346
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scabha/cargo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import re, importlib, sys
from collections import OrderedDict
from enum import Enum, IntEnum
from dataclasses import dataclass
from dataclasses import dataclass, field
from omegaconf import MISSING, ListConfig, DictConfig, OmegaConf

import rich.box
Expand Down Expand Up @@ -141,7 +141,7 @@ class Parameter(object):
nom_de_guerre: Optional[str] = None

# policies object, specifying a non-default way to handle this parameter
policies: ParameterPolicies = ParameterPolicies()
policies: ParameterPolicies = field(default_factory=ParameterPolicies)

# Parameter category, purely cosmetic, used for generating help and debug messages.
# Assigned automatically if None, but a schema may explicitly mark parameters as e.g.
Expand Down
2 changes: 1 addition & 1 deletion scabha/schema_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def nested_schema_to_dataclass(nested: Dict[str, Dict], class_name: str, bases=(
dcls = schema_to_dataclass(content, f"{class_name}_{section}",
bases=section_bases, post_init=post_init_map.get(section))

fields.append((section, dcls, field(default=dcls())))
fields.append((section, dcls, field(default_factory=dcls)))

# return the outer dataclass
return make_dataclass(class_name, fields, bases=bases)
Expand Down

0 comments on commit 143f346

Please sign in to comment.