Show More
@@ -592,10 +592,11 b' def _set_pprinter_factory(start, end, basetype):' | |||
|
592 | 592 | else: |
|
593 | 593 | step = len(start) |
|
594 | 594 | p.begin_group(step, start) |
|
595 |
# Like dictionary keys, we will try to sort the items |
|
|
596 |
items = |
|
|
595 | # Like dictionary keys, we will try to sort the items if there aren't too many | |
|
596 | items = obj | |
|
597 | if not (p.max_seq_length and len(obj) >= p.max_seq_length): | |
|
597 | 598 | try: |
|
598 |
items |
|
|
599 | items = sorted(obj) | |
|
599 | 600 | except Exception: |
|
600 | 601 | # Sometimes the items don't sort. |
|
601 | 602 | pass |
@@ -623,9 +624,11 b' def _dict_pprinter_factory(start, end, basetype=None):' | |||
|
623 | 624 | return p.text('{...}') |
|
624 | 625 | p.begin_group(1, start) |
|
625 | 626 | keys = obj.keys() |
|
627 | # if dict isn't large enough to be truncated, sort keys before displaying | |
|
628 | if not (p.max_seq_length and len(obj) >= p.max_seq_length): | |
|
626 | 629 | try: |
|
627 |
keys |
|
|
628 |
except Exception |
|
|
630 | keys = sorted(keys) | |
|
631 | except Exception: | |
|
629 | 632 | # Sometimes the keys don't sort. |
|
630 | 633 | pass |
|
631 | 634 | for idx, key in p._enumerate(keys): |
General Comments 0
You need to be logged in to leave comments.
Login now