From 89407089cd3f7de330a2dd049591e174376736fb Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Thu, 28 Oct 2021 10:34:09 -0700 Subject: [PATCH] test-runner: handle pyroute2 IW() between versions It appears different versions of pyroute2 may or may not have iwutil, and instead use pyroute2.IW() directly. Try the iwutil way first, then pyroute2.IW() --- tools/test-runner | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/test-runner b/tools/test-runner index 6c7a7e45..a1f86c00 100755 --- a/tools/test-runner +++ b/tools/test-runner @@ -853,7 +853,11 @@ class TestContext(Namespace): def discover_radios(self): phys = [] - iw = pyroute2.iwutil.IW() + + try: + iw = pyroute2.iwutil.IW() + except: + iw = pyroute2.IW() attrs = [phy['attrs'] for phy in iw.list_wiphy()]