From 8cf04f3a741d5bb59a85ca5e53b4068409adbff4 Mon Sep 17 00:00:00 2001 From: Shantanu Date: Sun, 24 May 2020 18:44:43 -0700 Subject: [PATCH] boto.compat, base64: fix version handling of (en|de)codebytes (#4070) Co-authored-by: hauntsaninja <> --- stdlib/2and3/base64.pyi | 5 +++-- third_party/2and3/boto/compat.pyi | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/stdlib/2and3/base64.pyi b/stdlib/2and3/base64.pyi index 2385f4071..d61cb3acd 100644 --- a/stdlib/2and3/base64.pyi +++ b/stdlib/2and3/base64.pyi @@ -31,9 +31,10 @@ if sys.version_info >= (3, 4): def b85decode(b: _decodable) -> bytes: ... def decode(input: IO[bytes], output: IO[bytes]) -> None: ... -def decodebytes(s: bytes) -> bytes: ... def encode(input: IO[bytes], output: IO[bytes]) -> None: ... -def encodebytes(s: bytes) -> bytes: ... +if sys.version_info >= (3,): + def encodebytes(s: bytes) -> bytes: ... + def decodebytes(s: bytes) -> bytes: ... if sys.version_info < (3, 9): def encodestring(s: bytes) -> bytes: ... def decodestring(s: bytes) -> bytes: ... diff --git a/third_party/2and3/boto/compat.pyi b/third_party/2and3/boto/compat.pyi index ce997030a..070c75fe8 100644 --- a/third_party/2and3/boto/compat.pyi +++ b/third_party/2and3/boto/compat.pyi @@ -1,7 +1,10 @@ import sys from typing import Any -from base64 import encodestring as encodebytes +if sys.version_info >= (3,): + from base64 import encodebytes as encodebytes +else: + from base64 import encodestring as encodebytes from six.moves import http_client