From: Jouni Malinen Date: Sun, 5 Jan 2014 06:46:45 +0000 (+0200) Subject: wpaspy: Add optional timeout argument for pending() X-Git-Tag: hostap_2_1~203 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=606110e647c4c8b0f5e328e5cc255faccca5655f;p=thirdparty%2Fhostap.git wpaspy: Add optional timeout argument for pending() This can be used to wait for up to the specified limit on new event messages. Signed-hostap: Jouni Malinen --- diff --git a/wpaspy/wpaspy.py b/wpaspy/wpaspy.py index 7c2314dc2..24c371908 100644 --- a/wpaspy/wpaspy.py +++ b/wpaspy/wpaspy.py @@ -70,8 +70,8 @@ class Ctrl: return None raise Exception("DETACH failed") - def pending(self): - [r, w, e] = select.select([self.s], [], [], 0) + def pending(self, timeout=0): + [r, w, e] = select.select([self.s], [], [], timeout) if r: return True return False