Skip to content

Commit

Permalink
check for empty namespace
Browse files Browse the repository at this point in the history
Prior to this commit it was possible to pop from an empty list,
generating an IndexError
  • Loading branch information
esquires committed Aug 12, 2017
1 parent b1cd4e7 commit 4d695a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ def generate(self):
self.namespaces.append(False)
continue
if token.name == '}':
if self.namespaces.pop():
if self.namespaces and self.namespaces.pop():
self.namespace_stack.pop()
continue

Expand Down

0 comments on commit 4d695a6

Please sign in to comment.