protobuf: changed return type annotation in loads to enhance granularity

This commit is contained in:
madt1m 2018-08-01 12:00:07 +02:00
parent ccb5fd7c99
commit afe41eb75c

View File

@ -189,7 +189,7 @@ def load_http(hf: http_pb2.HTTPFlow) -> HTTPFlow:
return f
def loads(b: bytes, typ="http") -> flow.Flow:
def loads(b: bytes, typ="http") -> typing.Union[HTTPFlow]:
if typ != 'http':
raise exceptions.TypeError("Flow types different than HTTP not supported yet!")
else: