diff --git a/acme/acme/jose/b64.py b/acme/acme/jose/b64.py index 5fccdce2e..cf79aa820 100644 --- a/acme/acme/jose/b64.py +++ b/acme/acme/jose/b64.py @@ -22,7 +22,7 @@ def b64encode(data): """JOSE Base64 encode. :param data: Data to be encoded. - :type data: `bytes` or `bytearray` + :type data: `bytes` :returns: JOSE Base64 string. :rtype: bytes @@ -30,9 +30,8 @@ def b64encode(data): :raises TypeError: if `data` is of incorrect type """ - if not isinstance(data, (six.binary_type, bytearray)): - raise TypeError('argument should be {0} or bytearray'.format( - six.binary_type)) + if not isinstance(data, six.binary_type): + raise TypeError('argument should be {0}'.format(six.binary_type)) return base64.urlsafe_b64encode(data).rstrip(b'=') diff --git a/acme/acme/jose/b64_test.py b/acme/acme/jose/b64_test.py index 989f8e7fe..cbabe2251 100644 --- a/acme/acme/jose/b64_test.py +++ b/acme/acme/jose/b64_test.py @@ -39,9 +39,6 @@ class B64EncodeTest(unittest.TestCase): for text, (b64, _) in six.iteritems(B64_PADDING_EXAMPLES): self.assertEqual(self._call(text), b64) - def test_bytearray_ok(self): - self.assertEqual(self._call(bytearray(b'foo')), b'Zm9v') - def test_unicode_fails_with_type_error(self): self.assertRaises(TypeError, self._call, u'some unicode')