From ac5e3cde968da295f6ced3bddd70a9760130565b Mon Sep 17 00:00:00 2001 From: Angelo Dell'Aera Date: Wed, 16 Nov 2022 10:12:12 +0100 Subject: [PATCH] atob() function minor improvement --- tests/functional/test_misc_ie90.py | 2 +- thug/DOM/Window.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/functional/test_misc_ie90.py b/tests/functional/test_misc_ie90.py index 111a28d8cd..c98f0dd9de 100644 --- a/tests/functional/test_misc_ie90.py +++ b/tests/functional/test_misc_ie90.py @@ -1266,7 +1266,7 @@ def test_testPlayStateChange(self, caplog): def test_testAtob(self, caplog): sample = os.path.join(self.misc_path, "testAtob.html") expected = ['Encoded String: SGVsbG8gV29ybGQ=', - 'Decoded String: Hello World'] + 'Decoded String: b\'Hello World\''] self.do_perform_test(caplog, sample, expected) diff --git a/thug/DOM/Window.py b/thug/DOM/Window.py index 63c0110154..66f8744d1c 100644 --- a/thug/DOM/Window.py +++ b/thug/DOM/Window.py @@ -1056,10 +1056,7 @@ def atob(self, s): """ The atob method decodes a base-64 encoded string """ - if isinstance(s, str): - s = s.encode() - - return base64.b64decode(s) + return str(base64.b64decode(s)) def btoa(self, s): """