From d6576799f85574afb29cd338a0016f15a26d6398 Mon Sep 17 00:00:00 2001 From: "pmoody@google.com" Date: Thu, 10 Dec 2009 03:34:05 +0000 Subject: + change RunTimeError to a simple assertion based on suggestion from mat smart. git-svn-id: https://ipaddr-py.googlecode.com/svn@128 09200d28-7f98-11dd-ad27-0f66e57d2035 --- trunk/ipaddr.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/trunk/ipaddr.py b/trunk/ipaddr.py index e2b0ac5..6d0e9df 100644 --- a/trunk/ipaddr.py +++ b/trunk/ipaddr.py @@ -642,9 +642,6 @@ class _BaseNet(_IPAddrBase): Raises: TypeError: If self and other are of difffering address versions. - RunTimeError: There was some unknown error in the address - exclusion process. This likely points to a bug elsewhere - in this code. ValueError: If other is not completely contained by self. """ @@ -671,18 +668,18 @@ class _BaseNet(_IPAddrBase): s1, s2 = s2.subnet() else: # If we got here, there's a bug somewhere. - raise RunTimeError('Error performing exclusion: ' - 's1: %s s2: %s other: %s' % - (str(s1), str(s2), str(other))) + assert True == False, ('Error performing exclusion: ' + 's1: %s s2: %s other: %s' % + (str(s1), str(s2), str(other))) if s1 == other: ret_addrs.append(s2) elif s2 == other: ret_addrs.append(s1) else: # If we got here, there's a bug somewhere. - raise RunTimeError('Error performing exclusion: ' - 's1: %s s2: %s other: %s' % - (str(s1), str(s2), str(other))) + assert True == False, ('Error performing exclusion: ' + 's1: %s s2: %s other: %s' % + (str(s1), str(s2), str(other))) return sorted(ret_addrs, key=_BaseNet._get_networks_key) -- cgit v1.2.1