[Git][NTPsec/ntpsec][master] It's a bad idea to try applying dictionary methods to strings.

Eric S. Raymond gitlab at mg.gitlab.com
Wed Dec 28 15:29:13 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
226e7100 by Eric S. Raymond at 2016-12-28T10:28:41-05:00
It's a bad idea to try applying dictionary methods to strings.

- - - - -


1 changed file:

- pylib/packet.py


Changes:

=====================================
pylib/packet.py
=====================================
--- a/pylib/packet.py
+++ b/pylib/packet.py
@@ -1291,6 +1291,7 @@ class ControlSession:
             else:
                 parms = ""
             req_buf += parms
+            first_time_only = "recent=%s" % variables.get("recent")
 
             while True:
                 # Request additions to the MRU list
@@ -1425,8 +1426,7 @@ class ControlSession:
 
 
                 # Only ship 'recent' on the first request
-                if 'recent' in parms:
-                    del parms['recent']
+                parms = parms.replace(first_time_only, "")
 
                 # Prepare next query with as many address and last-seen
                 # timestamps as will fit in a single packet.  A new nonce



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/226e71001a36324864d1d04f548e37eef81abde1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20161228/ad453a1b/attachment.html>


More information about the vc mailing list