summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpmoody@google.com <pmoody@google.com@09200d28-7f98-11dd-ad27-0f66e57d2035>2009-12-10 03:34:05 +0000
committerpmoody@google.com <pmoody@google.com@09200d28-7f98-11dd-ad27-0f66e57d2035>2009-12-10 03:34:05 +0000
commitd6576799f85574afb29cd338a0016f15a26d6398 (patch)
treee24d9bcd8a812eab897e5bc13285326bd604e11a
parent090ae09fd373e3981d9407736e5a77d0d4b7893e (diff)
downloadipaddr-py-d6576799f85574afb29cd338a0016f15a26d6398.tar.gz
+ 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
-rw-r--r--trunk/ipaddr.py15
1 files 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)