mirror of
https://github.com/openvswitch/ovs
synced 2025-10-11 13:57:52 +00:00
python tests: Fixed OSError not iterable on Windows
On Windows if this exception is triggered then it will raise an exception while in the exception handler. Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
This commit is contained in:
committed by
Gurucharan Shetty
parent
7b9d1b65eb
commit
8ac6d39624
@@ -17,6 +17,7 @@ import ovs.timeval
|
|||||||
import ovs.vlog
|
import ovs.vlog
|
||||||
import select
|
import select
|
||||||
import socket
|
import socket
|
||||||
|
import os
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import eventlet.patcher
|
import eventlet.patcher
|
||||||
@@ -168,6 +169,11 @@ class Poller(object):
|
|||||||
try:
|
try:
|
||||||
events = self.poll.poll(self.timeout)
|
events = self.poll.poll(self.timeout)
|
||||||
self.__log_wakeup(events)
|
self.__log_wakeup(events)
|
||||||
|
except OSError as e:
|
||||||
|
""" On Windows, the select function from poll raises OSError
|
||||||
|
exception if the polled array is empty."""
|
||||||
|
if e.errno != errno.EINTR:
|
||||||
|
vlog.err("poll: %s" % os.strerror(e.errno))
|
||||||
except select.error as e:
|
except select.error as e:
|
||||||
# XXX rate-limit
|
# XXX rate-limit
|
||||||
error, msg = e
|
error, msg = e
|
||||||
|
Reference in New Issue
Block a user