Skip to content

Commit

Permalink
oif: raise instantiated exceptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiSzuttor committed Aug 3, 2020
1 parent d2f437b commit dd6ff6e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/python/object_in_fluid/oif_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ class Edge:

def __init__(self, A, B):
if not all(isinstance(x, (PartPoint, FixedPoint)) for x in [A, B]):
TypeError("Arguments to Edge must be FixedPoint or PartPoint.")
raise TypeError(
"Arguments to Edge must be FixedPoint or PartPoint.")
self.A = A
self.B = B

Expand All @@ -126,7 +127,8 @@ class Triangle:

def __init__(self, A, B, C):
if not all(isinstance(x, (PartPoint, FixedPoint)) for x in [A, B, C]):
TypeError("Arguments to Triangle must be FixedPoint or PartPoint.")
raise TypeError(
"Arguments to Triangle must be FixedPoint or PartPoint.")
self.A = A
self.B = B
self.C = C
Expand All @@ -147,7 +149,8 @@ class Angle:
def __init__(self, A, B, C, D):
if not all(isinstance(x, (PartPoint, FixedPoint))
for x in [A, B, C, D]):
TypeError("Arguments to Angle must be FixedPoint or PartPoint.")
raise TypeError(
"Arguments to Angle must be FixedPoint or PartPoint.")
self.A = A
self.B = B
self.C = C
Expand All @@ -168,7 +171,7 @@ class ThreeNeighbors:

def __init__(self, A, B, C):
if not all(isinstance(x, (PartPoint, FixedPoint)) for x in [A, B, C]):
TypeError(
raise TypeError(
"Arguments to ThreeNeighbors must be FixedPoint or PartPoint.")
self.A = A
self.B = B
Expand Down

0 comments on commit dd6ff6e

Please sign in to comment.