Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit b289d79

Browse files
committed
Merge pull request #125 from jmullan/better_wrong_token_message
Better error message for wrong token kind in __all__
2 parents 28a119b + 8ddc9e5 commit b289d79

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pep257.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,8 @@ def parse_all(self):
378378
self.current.value == ','):
379379
all_content += self.current.value
380380
else:
381-
raise AllError('Could not evaluate contents of __all__. ')
381+
kind = token.tok_name[self.current.kind]
382+
raise AllError('Unexpected token kind in __all__: %s' % kind)
382383
self.stream.move()
383384
self.consume(tk.OP)
384385
all_content += ")"

0 commit comments

Comments
 (0)