[Git][NTPsec/ntpsec][master] Another fix on Python 3 missing basestring and unicode()

Gary E. Miller gitlab at mg.gitlab.com
Tue Aug 15 21:15:03 UTC 2017


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


Commits:
eadb0d5b by Gary E. Miller at 2017-08-15T14:13:49-07:00
Another fix on Python 3 missing basestring and unicode()

- - - - -


2 changed files:

- ntpclients/ntpmon
- pylib/util.py


Changes:

=====================================
ntpclients/ntpmon
=====================================
--- a/ntpclients/ntpmon
+++ b/ntpclients/ntpmon
@@ -282,7 +282,7 @@ if __name__ == '__main__':
                             raise Fatal(e.message)
                         except IOError as e:
                             raise Fatal(e.strerror)
-                        strconvert = unicode(peer_report.header() + "\n")
+                        strconvert = peer_report.header() + "\n"
                         stdscr.addstr(strconvert.encode('UTF-8'),
                                       curses.A_BOLD)
                     else:


=====================================
pylib/util.py
=====================================
--- a/pylib/util.py
+++ b/pylib/util.py
@@ -399,7 +399,7 @@ def unitify(value, startingunit, baseunit=None, width=8):
 def f8dot4(f):
     "Scaled floating point formatting to fit in 8 characters"
 
-    if isinstance(f, string):
+    if isinstance(f, str):
         # a string? pass it on as a signal
         return "%8s" % f
     if not isinstance(f, (int, float)):



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/eadb0d5b28cfd363cea14e6075a20a6e028dcc38

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/eadb0d5b28cfd363cea14e6075a20a6e028dcc38
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170815/f7956f01/attachment.html>


More information about the vc mailing list