Skip to content

Commit 513db52

Browse files
committed
misc: resolve deprecation warning for str.split()
In Python 3.13, usage of a positional argument for `maxsplit` has been formally deprecated. Refs: python/cpython#107778 Signed-off-by: Mike Fiedler <[email protected]>
1 parent b26e712 commit 513db52

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

newsfragments/+0ff2173d.misc.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
In Python 3.13, usage of a positional argument for `maxsplit` has been
2+
formally deprecated.
3+
Update code to use keyword argument `maxsplit` instead of positional.

pytest_postgresql/loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def build_loader(load: Union[Callable, str, Path]) -> Callable:
1313
if isinstance(load, Path):
1414
return partial(sql, load)
1515
elif isinstance(load, str):
16-
loader_parts = re.split("[.:]", load, 2)
16+
loader_parts = re.split("[.:]", load, maxsplit=2)
1717
import_path = ".".join(loader_parts[:-1])
1818
loader_name = loader_parts[-1]
1919
_temp_import = __import__(import_path, globals(), locals(), fromlist=[loader_name])

0 commit comments

Comments
 (0)