diff mbox series

[scarthgap,2.8] fetch2: Avoid deprecation warning

Message ID 20250605111018.97903-1-adrian.freihofer@siemens.com
State New
Headers show
Series [scarthgap,2.8] fetch2: Avoid deprecation warning | expand

Commit Message

Freihofer, Adrian June 5, 2025, 11:10 a.m. UTC
From: Richard Purdie <richard.purdie@linuxfoundation.org>

>From re on python 3.13 onwards: "Passing count and flags as positional arguments is deprecated.
In future Python versions they will be keyword-only parameters."

Avoid the warning.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/fetch2/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index e698fde19..1a6ff25d4 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -237,7 +237,7 @@  class URI(object):
         # to RFC compliant URL format. E.g.:
         #   file://foo.diff -> file:foo.diff
         if urlp.scheme in self._netloc_forbidden:
-            uri = re.sub("(?<=:)//(?!/)", "", uri, 1)
+            uri = re.sub(r"(?<=:)//(?!/)", "", uri, count=1)
             reparse = 1
 
         if reparse: