Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Beck committed Oct 23, 2018
1 parent 9afc06c commit 6702d5e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dbt/clients/jinja.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ def parse(self, parser):
return node


def _is_dunder_name(name):
return name.startswith('__') and name.endswith('__')


def create_macro_capture_env(node):

class ParserMacroCapture(jinja2.Undefined):
Expand Down Expand Up @@ -220,7 +224,7 @@ def __deepcopy__(self, memo):
)

def __getattr__(self, name):
if name == 'name' or name.startswith('__') and name.endswith('__'):
if name == 'name' or _is_dunder_name(name):
raise AttributeError(
"'{}' object has no attribute '{}'"
.format(type(self).__name__, name)
Expand Down

0 comments on commit 6702d5e

Please sign in to comment.