commit: 6bced738b96358f21d7f33f58836643a6bea6769 Author: Florian Schmaus <flow <AT> gentoo <DOT> org> AuthorDate: Thu Sep 11 19:51:07 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Fri Sep 12 21:16:09 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=6bced738
getbinpkg: Drop Python 2 compat code Signed-off-by: Florian Schmaus <flow <AT> gentoo.org> Part-of: https://github.com/gentoo/portage/pull/1459 Signed-off-by: Sam James <sam <AT> gentoo.org> lib/portage/getbinpkg.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/portage/getbinpkg.py b/lib/portage/getbinpkg.py index af62b66aba..4f30192cf8 100644 --- a/lib/portage/getbinpkg.py +++ b/lib/portage/getbinpkg.py @@ -164,11 +164,7 @@ def create_conn(baseurl, conn=None): http_headers = {} http_params = {} if username and password: - try: - encodebytes = base64.encodebytes - except AttributeError: - # Python 2 - encodebytes = base64.encodestring + encodebytes = base64.encodebytes unicode_bytes = encodebytes(_unicode_encode(f"{username}:{password}")).replace( b"\012", b"" )
