mirror of
https://github.com/adrienverge/yamllint.git
synced 2025-02-25 18:55:20 -06:00
parser: Fix crash with latest PyYAML
There is a backwards-incompatible change in PyYAML that induces a crash if `check_token()` is not called before `peek_token()`. See commit a02d17a in PyYAML or https://github.com/yaml/pyyaml/pull/150. Closes #105.
This commit is contained in:
parent
36b4776778
commit
54f21c0514
@ -125,7 +125,8 @@ def token_or_comment_generator(buffer):
|
||||
curr = yaml_loader.get_token()
|
||||
while curr is not None:
|
||||
next = yaml_loader.get_token()
|
||||
nextnext = yaml_loader.peek_token()
|
||||
nextnext = (yaml_loader.peek_token()
|
||||
if yaml_loader.check_token() else None)
|
||||
|
||||
yield Token(curr.start_mark.line + 1, curr, prev, next, nextnext)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user