Skip to content

Commit

Permalink
Fix Python 13 deprecation warning (#167)
Browse files Browse the repository at this point in the history
Fix warning regarding `maxsplit` argument in `re.split` being deprecated as a positional argument. In future Python versions, it will become an error and must be keyword-only.

Update Python test matrix to use 3.13.
  • Loading branch information
addisonElliott authored Jan 23, 2025
1 parent 92b170b commit 93318db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ['3.7', '3.9', '3.12']
python-version: ['3.7', '3.9', '3.13']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
Expand Down
2 changes: 1 addition & 1 deletion nrrd/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def read_header(file: Union[str, Iterable[AnyStr]], custom_field_map: Optional[N
break

# Read the field and value from the line, split using regex to search for := or : delimiter
field, value = re.split(r':=?', line, 1)
field, value = re.split(r':=?', line, maxsplit=1)

# Remove whitespace before and after the field and value
field, value = field.strip(), value.strip()
Expand Down

0 comments on commit 93318db

Please sign in to comment.