From 78a2e63e14c2949bc3fd7c645c5cf8481c7c56da Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Wed, 18 Nov 2015 10:38:41 +0100 Subject: [PATCH] Raise TypeError rather than generic Exception --- relational/relation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/relational/relation.py b/relational/relation.py index 0b18e1a..f69733c 100644 --- a/relational/relation.py +++ b/relational/relation.py @@ -118,12 +118,12 @@ class Relation (object): internally. Will raise an exception if they don't share the same attributes''' if not isinstance(other, relation): - raise Exception('Expected an instance of the same class') + raise TypeError('Expected an instance of the same class') elif self.header == other.header: return other elif self.header.sharedAttributes(other.header) == len(self.header): return other.projection(self.header) - raise Exception('Relations differ: [%s] [%s]' % ( + raise TypeError('Relations differ: [%s] [%s]' % ( ','.join(self.header), ','.join(other.header) ))