[Git][NTPsec/ntpsec][master] Fix gone in Python 3: dict_keys.sort()

Gary E. Miller gitlab at mg.gitlab.com
Sat Sep 10 20:03:31 UTC 2016


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
91032931 by Gary E. Miller at 2016-09-10T13:02:28-07:00
Fix gone in Python 3: dict_keys.sort()

The error:
    AttributeError: 'dict_keys' object has no attribute 'sort'

- - - - -


1 changed file:

- ntpstats/ntpviz


Changes:

=====================================
ntpstats/ntpviz
=====================================
--- a/ntpstats/ntpviz
+++ b/ntpstats/ntpviz
@@ -1032,7 +1032,8 @@ ntpviz</a>, part of the <a href="https://www.ntpsec.org/">NTPsec project</a>
             ]
 
         peerlist = stats.peersplit().keys()
-        peerlist.sort() # sort for output order stability
+        # sort for output order stability
+        peerlist = sorted( peerlist )
         for key in peerlist:
             imagepairs.append(("peer-offset-" + key,
                            stats.peer_offsets_gnuplot([key])))



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/910329311edcb4f52e40f0ba5e1eb9afed03f75e
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160910/84624a5a/attachment.html>


More information about the vc mailing list