From 2d9c4f2abae6c146a35bd984b215b355bf658827 Mon Sep 17 00:00:00 2001 From: Ruben Gonzalez Date: Thu, 1 Feb 2024 15:38:32 +0100 Subject: [PATCH] wrap: default values for netrc are empty string from python 3.11 From python 3.11 [1]: > The entry in the netrc file no longer needs to contain all tokens. The missing > tokens' value default to an empty string. All the tokens and their values now > can contain arbitrary characters, like whitespace and non-ASCII characters. > If the login name is anonymous, it won't trigger the security check. [1] https://github.com/python/cpython/commit/15409c720be0503131713e3d3abc1acd0da07378 --- mesonbuild/wrap/wrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py index 9a310bc414f6..0e64be87e980 100644 --- a/mesonbuild/wrap/wrap.py +++ b/mesonbuild/wrap/wrap.py @@ -656,7 +656,7 @@ def get_netrc_credentials(self, netloc: str) -> T.Optional[T.Tuple[str, str]]: return None login, account, password = self.netrc.authenticators(netloc) - if account is not None: + if account: login = account return login, password