Skip to content

Commit

Permalink
Merge pull request #1165 from rizar/lenient_sanity_check
Browse files Browse the repository at this point in the history
Warn instead of raising when the hierarchy is not respected
  • Loading branch information
rizar committed Nov 14, 2016
2 parents 6b68ea6 + 8c9cf33 commit 3db89c0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions blocks/bricks/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import inspect
import warnings
from abc import ABCMeta
from collections import OrderedDict
from six import wraps
Expand Down Expand Up @@ -287,11 +288,11 @@ def apply(self, bound_application, *args, **kwargs):
last_brick = self.call_stack[-1] if self.call_stack else None
if (last_brick and brick is not last_brick and
brick not in last_brick.children):
raise ValueError('Brick ' + str(self.call_stack[-1]) + ' tries '
'to call brick ' + str(self.brick) + ' which '
'is not in the list of its children. This could '
'be caused because an @application decorator is '
'missing.')
warnings.warn('Brick ' + str(self.call_stack[-1]) + ' tries '
'to call brick ' + str(self.brick) + ' which '
'is not in the list of its children. This could '
'be caused because an @application decorator is '
'missing.')
self.call_stack.append(brick)
try:
outputs = self.application_function(brick, *args, **kwargs)
Expand Down

0 comments on commit 3db89c0

Please sign in to comment.