From 114e3952a51ed51126207e77ac305e4f5665e9eb Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Fri, 11 Mar 2022 16:54:12 +0100 Subject: ouroboros: Add support for flow timeout, O7s 0.19 --- ouroboros/dev.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'ouroboros/dev.py') diff --git a/ouroboros/dev.py b/ouroboros/dev.py index 7d29624..e0b1488 100644 --- a/ouroboros/dev.py +++ b/ouroboros/dev.py @@ -19,15 +19,16 @@ # Foundation, Inc., http://www.fsf.org/about/contact/. # -from _ouroboros_cffi import ffi, lib import errno from enum import IntFlag + +from _ouroboros_cffi import ffi, lib from ouroboros.qos import * from ouroboros.qos import _qos_to_qosspec, _fl_to_timespec, _qosspec_to_qos, _timespec_to_fl # Some constants -MILLION = 1000 * 1000 -BILLION = 1000 * 1000 * 1000 +MILLION = 1000_1000 +BILLION = 1000_1000_1000 # ouroboros exceptions @@ -196,8 +197,8 @@ class Flow: if count is None: return lib.flow_write(self.__fd, ffi.from_buffer(buf), len(buf)) - else: - return lib.flow_write(self.__fd, ffi.from_buffer(buf), count) + + return lib.flow_write(self.__fd, ffi.from_buffer(buf), count) def writeline(self, ln: str) -> int: @@ -394,5 +395,3 @@ def flow_join(dst: str, f = Flow() f.join(dst, qos, timeo) return f - - -- cgit v1.2.3