Commit 605d5668 authored by Maiken's avatar Maiken
Browse files

Merge branch 'python-3.9-compatibility' into 'master'

Compatibility with Python 3.9.

See merge request nordugrid/arc!927
parents ffb55404 2ba3973e
......@@ -26,6 +26,9 @@ class BitVector(object):
else:
assert n_bits == len(bits) * TYPE_SIZE, "Size and given bits does not match"
self.bits = array.array(ARRAY_TYPE)
try:
self.bits.frombytes(bits)
except AttributeError:
self.bits.fromstring(bits)
......@@ -41,4 +44,7 @@ class BitVector(object):
def tostring(self):
try:
return self.bits.tobytes()
except AttributeError:
return self.bits.tostring()
......@@ -104,6 +104,9 @@ class BloomFilter(object):
def serialize(self):
try:
return self.bits.tobytes()
except AttributeError:
return self.bits.tostring()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment