summaryrefslogtreecommitdiff
path: root/ipaddr.py
diff options
context:
space:
mode:
authorPeter Moody <pmoody@google.com>2009-12-10 03:34:05 +0000
committerPeter Moody <pmoody@google.com>2009-12-10 03:34:05 +0000
commitf2b5f90f24c0cc22d45a8b6fc9efb7f9a7f55540 (patch)
tree5392d45530b8aa461c839b734c7248f2eb75ef14 /ipaddr.py
parent6dfd8e6f02f33cfa668997f0d06faaafeced57cb (diff)
downloadipaddr-py-f2b5f90f24c0cc22d45a8b6fc9efb7f9a7f55540.tar.gz
+ change RunTimeError to a simple assertion based on suggestion
from mat smart. git-svn-id: https://ipaddr-py.googlecode.com/svn/trunk@128 09200d28-7f98-11dd-ad27-0f66e57d2035
Diffstat (limited to 'ipaddr.py')
-rw-r--r--ipaddr.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/ipaddr.py b/ipaddr.py
index e2b0ac5..6d0e9df 100644
--- a/ipaddr.py
+++ b/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)