[Git][NTPsec/ntpsec][master] Address Gitlsab issue #574: Use self.warn()...

Eric S. Raymond gitlab at mg.gitlab.com
Wed Jun 19 16:11:21 UTC 2019



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


Commits:
1e946d78 by Eric S. Raymond at 2019-06-19T16:09:49Z
Address Gitlsab issue #574: Use self.warn()...

...for warnings/errors in ntpclients/ntpq.py instead of print()

- - - - -


1 changed file:

- ntpclients/ntpq.py


Changes:

=====================================
ntpclients/ntpq.py
=====================================
@@ -1647,7 +1647,7 @@ if __name__ == '__main__':
             cast = ntp.util.safeargcast(val, int, errmsg, usage)
             session.debug = interpreter.debug = cast
         elif switch in ("-h", "--help"):
-            print(usage)
+            sys.stderr.write(usage)
             raise SystemExit(0)
         elif switch in ("-n", "--numeric"):
             interpreter.showhostnames = False
@@ -1656,7 +1656,7 @@ if __name__ == '__main__':
         elif switch in ("-k", "--keyfile"):
             keyfile = val
         elif switch in ("-V", "--version"):
-            print("ntpq %s" % version)
+            sys.stdout.write("ntpq %s\n" % version)
             raise SystemExit(0)
         elif switch in ("-w", "--wide"):
             interpreter.wideremote = True
@@ -1732,5 +1732,5 @@ if __name__ == '__main__':
     except ntp.packet.ControlException as e:
         interpreter.warn(e.message)
     except IOError:
-        print("Bailing out...")
+        sys.stderr.write("Bailing out...\n")
 # end



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

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/1e946d785dbb1adf370d6c92f45cd40b4013032c
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/20190619/d12d9eb6/attachment-0001.htm>


More information about the vc mailing list