From: Douglas Bagnall Date: Tue, 11 Jun 2024 23:14:42 +0000 (+1200) Subject: pytest: remove py2 str/bytes workaround in lsa_utils X-Git-Tag: tdb-1.4.11~379 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2dc111b4c186d102b6b4ebdc50778ccb1cf58e36;p=thirdparty%2Fsamba.git pytest: remove py2 str/bytes workaround in lsa_utils It is likely not necessary to cast to list() in most cases. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/dcerpc/lsa_utils.py b/python/samba/tests/dcerpc/lsa_utils.py index d6da5eb60bd..229f57ec546 100644 --- a/python/samba/tests/dcerpc/lsa_utils.py +++ b/python/samba/tests/dcerpc/lsa_utils.py @@ -107,9 +107,7 @@ class CreateTrustedDomain(TestCase): info.trust_type = lsa.LSA_TRUST_TYPE_UPLEVEL info.trust_attributes = lsa.LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE - password_blob = samba.string_to_byte_array( - "password".encode('utf-16-le') - ) + password_blob = list("password".encode('utf-16-le')) clear_value = drsblobs.AuthInfoClear() clear_value.size = len(password_blob) @@ -198,9 +196,7 @@ class CreateTrustedDomain(TestCase): info.trust_type = lsa.LSA_TRUST_TYPE_UPLEVEL info.trust_attributes = lsa.LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE - password_blob = samba.string_to_byte_array( - "password".encode('utf-16-le') - ) + password_blob = list("password".encode('utf-16-le')) clear_value = drsblobs.AuthInfoClear() clear_value.size = len(password_blob)