From gitlab at mg.gitlab.com Mon Oct 13 22:22:50 2025 From: gitlab at mg.gitlab.com (Gary E. Miller (@garyedmundsmiller)) Date: Mon, 13 Oct 2025 22:22:50 +0000 Subject: [Git][NTPsec/ntpsec][master] ntpq: Fix for Python 2. Message-ID: <68ed7bbab557e_2ce0ca48787d@gitlab-sidekiq-low-urgency-cpu-bound-v2-6469d5b86d-gr64n.mail> Gary E. Miller pushed to branch master at NTPsec / ntpsec Commits: 7884fdcc by Fred Wright at 2025-10-02T17:54:37-07:00 ntpq: Fix for Python 2. As noted in the comment: The BrokenPipeError doesn't exist in Python 2, but the problem that requires catching it also doesn't seem to exist in Python 2, so just make it a dummy in Python 2. This just restores the old Python 2 behavior, without suppressing the "Bailing out..." message. TESTED: Tested with Python 2.7 and 3.3-3.13. - - - - - 1 changed file: - ntpclients/ntpq.py Changes: ===================================== ntpclients/ntpq.py ===================================== @@ -25,6 +25,14 @@ import socket import sys import time +# The BrokenPipeError doesn't exist in Python 2, but the problem that requires +# catching it also doesn't seem to exist in Python 2, so just make it a dummy +# in Python 2. +try: + BrokenPipeError +except NameError: + BrokenPipeError = None + try: import ntp.control import ntp.ntpc View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/7884fdccb9e5d9c6aca31850200d08f497035429 -- View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/7884fdccb9e5d9c6aca31850200d08f497035429 You're receiving this email because of your account on gitlab.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: