From b7bb8df358a20cf0450701c0938e96ba848eba56 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Tue, 21 Sep 2021 15:11:50 +0300 Subject: [PATCH] Remove py3 indirection for _to_binary --- ulid2.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ulid2.py b/ulid2.py index 0c5865a..99439eb 100644 --- a/ulid2.py +++ b/ulid2.py @@ -29,12 +29,12 @@ class InvalidULID(ValueError): def _to_binary(byte_list): - if py3: - return bytes(byte_list) - else: - return bytes(b''.join(chr(b) for b in byte_list)) + return bytes(b''.join(chr(b) for b in byte_list)) +if py3: + _to_binary = bytes + # Unrolled and optimized ULID Base32 encoding/decoding # implementations based on NUlid: # https://github.com/RobThree/NUlid/blob/5f2678b4d/NUlid/Ulid.cs#L159