Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 93318db

Browse files
Fix Python 13 deprecation warning (#167)
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.
1 parent 92b170b commit 93318db

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-22.04
99
strategy:
1010
matrix:
11-
python-version: ['3.7', '3.9', '3.12']
11+
python-version: ['3.7', '3.9', '3.13']
1212
steps:
1313
- uses: actions/checkout@v3
1414
- uses: actions/setup-python@v3

nrrd/reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def read_header(file: Union[str, Iterable[AnyStr]], custom_field_map: Optional[N
279279
break
280280

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

284284
# Remove whitespace before and after the field and value
285285
field, value = field.strip(), value.strip()

0 commit comments

Comments
 (0)