Skip to contentSkip to conversation

fetch2: Avoid deprecation warning

PATCH New Richard Purdie 1 participant 1 message Oct 3, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fetch2: Avoid deprecation warning

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.

---
 lib/bb/fetch2/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/fetch2/__init__.py +1 -1
index 33a8086f27..b194a79be9 100644
@@ -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: