Skip to content

Commit

Permalink
Merge pull request #1281 from nipreps/fix/1264-toml-read-bug
Browse files Browse the repository at this point in the history
FIX: Bug in *toml* loader crashing with mixed arrays in config
  • Loading branch information
oesteban authored Apr 17, 2024
2 parents 09c32df + aba40b8 commit 29ad9cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mriqc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,10 @@ def from_dict(sections):

def load(filename):
"""Load settings from file."""
from toml import loads
try:
from tomllib import loads
except ModuleNotFoundError: # Python < 3.11
from tomli import loads

filename = Path(filename)
sections = loads(filename.read_text())
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies = [
"statsmodels",
"templateflow",
"toml",
"tomli >= 1.1.0; python_version < '3.11'",
"torch >= 1.10.2",
]
description = "Automated Quality Control and visual reports for Quality Assessment of structural (T1w, T2w) and functional MRI of the brain."
Expand Down

0 comments on commit 29ad9cc

Please sign in to comment.