Skip to content

Commit

Permalink
Merge pull request #1049 from miketheman/miketheman/warnings
Browse files Browse the repository at this point in the history
misc: resolve deprecation warning for `str.split()`
  • Loading branch information
fizyk authored Jan 8, 2025
2 parents b3ded64 + 513db52 commit b59c6fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions newsfragments/+0ff2173d.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
In Python 3.13, usage of a positional argument for `maxsplit` has been
formally deprecated.
Update code to use keyword argument `maxsplit` instead of positional.
2 changes: 1 addition & 1 deletion pytest_postgresql/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def build_loader(load: Union[Callable, str, Path]) -> Callable:
if isinstance(load, Path):
return partial(sql, load)
elif isinstance(load, str):
loader_parts = re.split("[.:]", load, 2)
loader_parts = re.split("[.:]", load, maxsplit=2)
import_path = ".".join(loader_parts[:-1])
loader_name = loader_parts[-1]
_temp_import = __import__(import_path, globals(), locals(), fromlist=[loader_name])
Expand Down

0 comments on commit b59c6fc

Please sign in to comment.