diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-02-10 17:34:25 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-02-10 17:34:25 +0000 |
commit | 0bb42730e8fc9c8e571f12e3189c6c6f8d532c24 (patch) | |
tree | cba6032fbed30be2b0764494607c3ec9dda0c18a /dev-python/re-assert/files | |
parent | cc901a8ce7c6bfe97e3b4f048619693d360ae348 (diff) |
gentoo auto-resync : 10:02:2024 - 17:34:25
Diffstat (limited to 'dev-python/re-assert/files')
-rw-r--r-- | dev-python/re-assert/files/re-assert-1.1.0-re-fallback.patch | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/dev-python/re-assert/files/re-assert-1.1.0-re-fallback.patch b/dev-python/re-assert/files/re-assert-1.1.0-re-fallback.patch index ad04e09ae5bc..b292d48d6e0f 100644 --- a/dev-python/re-assert/files/re-assert-1.1.0-re-fallback.patch +++ b/dev-python/re-assert/files/re-assert-1.1.0-re-fallback.patch @@ -1,16 +1,42 @@ diff --git a/re_assert.py b/re_assert.py -index f6ea6b9..66479c3 100644 +index 840401e..8818da1 100644 --- a/re_assert.py +++ b/re_assert.py -@@ -3,7 +3,10 @@ from __future__ import annotations +@@ -1,8 +1,13 @@ ++import sys ++ from typing import Any + from typing import Optional from typing import Pattern -import regex -+try: ++if sys.implementation.name == "cpython": + import regex -+except ImportError: ++else: + import re as regex class Matches: # TODO: Generic[AnyStr] (binary pattern support) +@@ -12,6 +17,9 @@ class Matches: # TODO: Generic[AnyStr] (binary pattern support) + self._type = type(pattern) + + def _fail_message(self, fail: str) -> str: ++ if sys.implementation.name != "cpython": ++ return "regex failed to match" ++ + # binary search to find the longest substring match + pos, bound = 0, len(fail) + while pos < bound: +diff --git a/setup.cfg b/setup.cfg +index 46303ca..74cf999 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -20,7 +20,7 @@ classifiers = + [options] + py_modules = re_assert + install_requires = +- regex ++ regex; python_implementation=="CPython" + python_requires = >=3.6.1 + + [bdist_wheel] |