1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-09 22:36:14 +01:00

Merge commit 'refs/pull/987/head' of github.com:openSUSE/osc

Handle SIGWINCH more gracefully. This is also needed to work
around an issue in m2crypto (see the discussion [1]).

[1] https://github.com/openSUSE/osc/pull/987
This commit is contained in:
Marcus Huewe 2022-01-07 16:20:11 +01:00
commit dd3908c56f
2 changed files with 8 additions and 3 deletions

View File

@ -57,9 +57,6 @@ for name in 'SIGBREAK', 'SIGHUP', 'SIGTERM':
if num:
signal.signal(num, catchterm)
# Signals which should be ignored
for sig in (signal.SIGWINCH,):
signal.signal(sig, signal.SIG_IGN)
def run(prg, argv=None):
try:

View File

@ -3,6 +3,9 @@
# and distributed under the terms of the GNU General Public Licence,
# either version 2, or (at your option) any later version.
import signal
try:
import progressbar as pb
have_pb_module = True
@ -23,6 +26,11 @@ class PBTextMeter(object):
# a ZeroDivisionException
widgets.insert(1, pb.Percentage())
self.bar = pb.ProgressBar(widgets=widgets, maxval=size)
# When a signal handler is set, it resets SA_RESTART flag
# - see signal.siginterrupt() python docs.
# ProgressBar's constructor sets signal handler for SIGWINCH.
# So let's make sure that it doesn't interrupt syscalls in osc.
signal.siginterrupt(signal.SIGWINCH, False)
self.bar.start()
def update(self, amount_read):