Fix Versionstamp encoding issue for Value objects
Python's struct.pack does not accept Value objects.
This commit is contained in:
parent
ce37a0cf7f
commit
156962e5bf
|
@ -180,8 +180,11 @@ class Versionstamp(object):
|
|||
return "Versionstamp(" + repr(self.tr_version) + ", " + str(self.user_version) + ")"
|
||||
|
||||
def to_bytes(self):
|
||||
tr_version = self.tr_version
|
||||
if isinstance(tr_version, fdb.impl.Value):
|
||||
tr_version = tr_version.value
|
||||
return struct.pack(self._STRUCT_FORMAT_STRING,
|
||||
self.tr_version if self.is_complete() else self._UNSET_TR_VERSION,
|
||||
tr_version if self.is_complete() else self._UNSET_TR_VERSION,
|
||||
self.user_version)
|
||||
|
||||
def completed(self, new_tr_version):
|
||||
|
|
Loading…
Reference in New Issue