Skip to content

Commit

Permalink
Add a key argument to avoid type errors when sorting annotations in…
Browse files Browse the repository at this point in the history
… 3.5.

Ughhh

PiperOrigin-RevId: 304291925
  • Loading branch information
rchen152 committed Apr 2, 2020
1 parent 729fc21 commit 430779a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytype/annotations_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def convert_class_annotations(self, node, raw_annotations):
raw_items = raw_annotations.items()
if sys.version_info[:2] < (3, 6):
# Make sure annotation errors are reported in a deterministic order.
raw_items = sorted(raw_items)
raw_items = sorted(raw_items, key=str)
for name, t in raw_items:
# Don't use the parameter name, since it's often something unhelpful
# like `0`.
Expand Down

0 comments on commit 430779a

Please sign in to comment.