diff --git a/src/django_pg_hll/values.py b/src/django_pg_hll/values.py index 9c539cb..b72d045 100644 --- a/src/django_pg_hll/values.py +++ b/src/django_pg_hll/values.py @@ -36,7 +36,7 @@ def __init__(self, data, *args, **extra): # Psycopg2 returns Binary results as hex string, prefixed by \x but requires bytes for saving. if isinstance(data, six.string_types) and data.startswith(r'\x'): - data = bytes.fromhex(data[2:]) + data = bytearray.fromhex(data[2:]) elif isinstance(data, bytes): pass else: