From deb37449f5345e7c6533227b72cfbf0406b0610e Mon Sep 17 00:00:00 2001 From: Romain Date: Sun, 30 May 2021 11:56:27 +0200 Subject: [PATCH] #336 Add ensure_bytes alias to ensure_binary --- six.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/six.py b/six.py index 4e15675d..0315fde1 100644 --- a/six.py +++ b/six.py @@ -913,6 +913,11 @@ def ensure_binary(s, encoding='utf-8', errors='strict'): raise TypeError("not expecting type '%s'" % type(s)) +def ensure_bytes(s, encoding='utf-8', errors='strict'): + """Alias of ensure_binary""" + return ensure_binary(s, encoding, errors) + + def ensure_str(s, encoding='utf-8', errors='strict'): """Coerce *s* to `str`.