From ee463ef4e067773c94b0e3266e0838ce93ac5ef6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 20 Aug 2019 04:12:41 +0200 Subject: [PATCH] python: do not report handled EAGAIN error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit match_watch_by_token() when returns an error, sets also exception within python. This is generally the right thing to do, but when xspy_read_watch() handle EAGAIN error internally, the exception needs to be cleared. Otherwise it will fail like this: xen.lowlevel.xs.Error: (11, 'Resource temporarily unavailable') The above exception was the direct cause of the following exception: Traceback (most recent call last): (...) result = self.handle.read_watch() SystemError: returned a result with an error set Fixes f6e1023412 "python: Extract registered watch search logic from xspy_read_watch()" Signed-off-by: Marek Marczykowski-Górecki Acked-by: Wei Liu --- tools/python/xen/lowlevel/xs/xs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/python/xen/lowlevel/xs/xs.c b/tools/python/xen/lowlevel/xs/xs.c index ea50f86bc3..621039d7a7 100644 --- a/tools/python/xen/lowlevel/xs/xs.c +++ b/tools/python/xen/lowlevel/xs/xs.c @@ -531,6 +531,7 @@ again: free(xsval); if (!val && errno == EAGAIN) { + PyErr_Clear(); goto again; } -- 2.30.2