From c1c2d76ba9ec33fd94a06ba8c698d21bf4e1b774 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 17 Dec 2012 16:28:23 -0500 Subject: client: Respond to ^C right away if possible. --- libdimension-python/dimension.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libdimension-python') diff --git a/libdimension-python/dimension.pyx b/libdimension-python/dimension.pyx index abfa8eb..a50f247 100644 --- a/libdimension-python/dimension.pyx +++ b/libdimension-python/dimension.pyx @@ -1,5 +1,5 @@ ######################################################################### -# Copyright (C) 2011 Tavian Barnes # +# Copyright (C) 2011-2012 Tavian Barnes # # # # This file is part of The Dimension Python Module. # # # @@ -96,6 +96,8 @@ cdef class Future: return self def __exit__(self, exc_type, exc_value, traceback): if self._future != NULL: + if exc_value is not None: + self.cancel() self.join() return False -- cgit v1.2.3