Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile committed Jun 2, 2016
1 parent f9a8d18 commit bf00535
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Cheetah/legacy_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ def matchTopLevelToken(self):
Returns None if no match.
"""
match = None
if self.peek() in '#$':
for matcher in (
self.matchCommentStartToken,
Expand All @@ -232,8 +231,8 @@ def matchTopLevelToken(self):
):
match = matcher()
if match:
break
return match
return match
return None

def getPyToken(self):
match = python_token_re.match(self.src(), self.pos())
Expand Down Expand Up @@ -847,7 +846,7 @@ def eatSimpleIndentingDirective(self, directiveName, callback):
expr = self.getExpression(pyTokensToBreakAt=[':'])
if self.matchColonForSingleLineShortFormDirective():
self.advance() # skip over :
if directiveName in 'else elif except finally'.split():
if directiveName in {'else', 'elif', 'except', 'finally'}:
callback(expr, lineCol, dedent=False)
else:
callback(expr, lineCol)
Expand Down

0 comments on commit bf00535

Please sign in to comment.