[Git][NTPsec/ntpsec][master] Bugfix for iso_to_posix().

Eric S. Raymond gitlab at mg.gitlab.com
Mon Aug 22 21:49:04 UTC 2016


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


Commits:
8dfc3914 by Eric S. Raymond at 2016-08-22T17:48:59-04:00
Bugfix for iso_to_posix().

- - - - -


1 changed file:

- pylib/statfiles.py


Changes:

=====================================
pylib/statfiles.py
=====================================
--- a/pylib/statfiles.py
+++ b/pylib/statfiles.py
@@ -147,10 +147,10 @@ class NTPStats:
 
 def iso_to_posix(s):
     "Accept timestamps in ISO8661 format or numeric POSIX time."
-    if s.isdigit(s):
+    if s.isdigit():
         return int(s)
     else:
-        return time.mktime(time.strptime(date, "%Y-%m-%dT%H:%M:%S"))
+        return time.mktime(time.strptime(s, "%Y-%m-%dT%H:%M:%S"))
 
 def posix_to_iso(t):
     "ISO8601 string from Unix time."



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/8dfc391434bdda30c59f1f04392a72267f35cd82
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160822/7b357d5e/attachment.html>


More information about the vc mailing list