[stem/master] Replace bytes.fromhex()

commit 5948cc6761c0506d8c2ba2640ad68752b08cbe3b Author: Damian Johnson <atagar@torproject.org> Date: Sat Oct 12 13:33:55 2019 -0700 Replace bytes.fromhex() ====================================================================== ERROR: test_encode_decode_descriptor ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/atagar/Desktop/stem/test/unit/descriptor/hidden_service_v3.py", line 272, in test_encode_decode_descriptor blind_param = bytes.fromhex("677776AE42464CAAB0DF0BF1E68A5FB651A390A6A8243CF4B60EE73A6AC2E4E3") AttributeError: type object 'str' has no attribute 'fromhex' --- test/unit/descriptor/hidden_service_v3.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/unit/descriptor/hidden_service_v3.py b/test/unit/descriptor/hidden_service_v3.py index 50a54543..ba236ce8 100644 --- a/test/unit/descriptor/hidden_service_v3.py +++ b/test/unit/descriptor/hidden_service_v3.py @@ -269,7 +269,9 @@ class TestHiddenServiceDescriptorV3(unittest.TestCase): intro3 = self._helper_get_intro() intro_points = [intro1, intro2, intro3] - blind_param = bytes.fromhex("677776AE42464CAAB0DF0BF1E68A5FB651A390A6A8243CF4B60EE73A6AC2E4E3") + # TODO: replace with bytes.fromhex() when we drop python 2.x support + + blind_param = bytearray.fromhex("677776AE42464CAAB0DF0BF1E68A5FB651A390A6A8243CF4B60EE73A6AC2E4E3") # Build the descriptor desc_string = HiddenServiceDescriptorV3.content(ed25519_private_identity_key=private_identity_key,
participants (1)
-
atagar@torproject.org