Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,13 @@ jobs:
uses: vmactions/solaris-vm@v1
with:
prepare: |
pkg install developer/gcc developer/build/gnu-make developer/build/pkg-config developer/versioning/git
pkg install developer/gcc developer/build/gnu-make developer/build/pkg-config developer/versioning/git web/curl
copyback: false
run: |
curl -V

echo "=============="

export LDFLAGS="-L/usr/lib/amd64 -L/usr/lib/64"
export CFLAGS="-m64"
export LD_LIBRARY_PATH=/usr/lib/amd64:$LD_LIBRARY_PATH
Expand Down
2 changes: 2 additions & 0 deletions pcre/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
split,
sub,
subn,
template,
)
from .threads import configure_thread_pool, configure_threads, shutdown_thread_pool

Expand Down Expand Up @@ -124,6 +125,7 @@ def escape(pattern: Any) -> Any:
"split",
"sub",
"subn",
"template",
"shutdown_thread_pool",
"error",
"PatternError",
Expand Down
12 changes: 11 additions & 1 deletion pcre/pcre.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import re as _std_re
from collections.abc import Generator, Iterable
try:
from re import _parser # python 3.11+
from re import _parser, TEMPLATE # python 3.11+
except Exception:
import sre_parse as _parser
from typing import Any, List
Expand Down Expand Up @@ -584,6 +584,16 @@ def subn(
) -> tuple[Any, int]:
return compile(pattern, flags=flags).subn(repl, string, count=count)

# add this function to bypass signatures unit test
# re.template() is deprecated and removed since python 3.12
def template(pattern, flags=0):
import warnings
warnings.warn("The re.template() function is deprecated "
"as it is an undocumented function "
"without an obvious purpose. "
"Use re.compile() instead.",
DeprecationWarning)
return compile(pattern, flags | TEMPLATE)

_PARALLEL_EXEC_METHODS = frozenset({"match", "search", "fullmatch", "findall"})

Expand Down
Loading