make-test: fix ValueError raised by hook in python3 55/18555/2
authorNaveen Joy <najoy@cisco.com>
Wed, 27 Mar 2019 21:28:50 +0000 (14:28 -0700)
committerPaul Vinciguerra <pvinci@vinciconsulting.com>
Wed, 27 Mar 2019 23:53:49 +0000 (23:53 +0000)
Without this patch, the hook module raises a ValueError
when tests are run using python3. This patch updates the
exception being caught by ipaddress to ValueError.

Change-Id: I5e11e292a05ddf350fc04ebaf19cfd7dad2bd9d0
Signed-off-by: Naveen Joy <najoy@cisco.com>
test/hook.py

index 555fc2e..ccc5c86 100644 (file)
@@ -39,7 +39,7 @@ class Hook(object):
                 # we don't call test_type(val) because it is a packed value.
                 return '{!s} ({!s})'.format(val, str(
                     ipaddress.ip_address(val)))
-            except ipaddress.AddressValueError:
+            except ValueError:
                 return val
 
         _args = ', '.join("{!s}={!r}".format(key, _friendly_format(val)) for