From 1745352a32d04a2d82bf267f77781f84966e5a07 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Thu, 13 Jul 2017 19:49:08 -0700 Subject: [PATCH] We don't use to_bytes either (we use int.to_bytes) --- blocksfree/legacy.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/blocksfree/legacy.py b/blocksfree/legacy.py index d91e98c..3360a87 100755 --- a/blocksfree/legacy.py +++ b/blocksfree/legacy.py @@ -799,23 +799,6 @@ def to_hex(val): else: raise Exception("to_hex() requires bytes, int/long, or [bin-ustr]") -def to_bytes(val): - """converts hex-ustr, int/long, or [bin-ustr] to bytes""" - if isinstance(val, list): # [bin-ustr] - val = to_hex(val[0]) - if isnumber(val): # int/long - if val < 256: - return chr(val).encode() - else: - val = to_hex(val) - - if isinstance(val, str): # hex-ustr - return a2b_hex(val.encode()) - elif isinstance(val, bytes): - return val - else: - raise Exception("to_bytes() requires hex-ustr, int/long, or [bin-ustr]") - def touch(file_path, modTime=None): # http://stackoverflow.com/questions/1158076/implement-touch-using-python #print(file_path)