2025-05-28 09:21:18 +00:00
committed by Git OBS Bridge
parent a08e0fa356
commit a7b3d8b069
2 changed files with 6 additions and 6 deletions

View File

@@ -38,7 +38,7 @@ index 9b59ddd887aa0b..b6421c7a3c827b 100644
@@ -2435,10 +2434,6 @@ def run(self):
self.close()
self.running = False
- # normally, we'd just stop here, but for the test
- # harness, we want to stop the server
- self.server.stop()
@@ -51,7 +51,7 @@ index 9b59ddd887aa0b..b6421c7a3c827b 100644
threading.Thread.__init__(self)
self.daemon = True
+ self._in_context = False
def __enter__(self):
+ if self._in_context:
+ raise ValueError('Re-entering ThreadedEchoServer context')
@@ -59,20 +59,20 @@ index 9b59ddd887aa0b..b6421c7a3c827b 100644
self.start(threading.Event())
self.flag.wait()
return self
def __exit__(self, *args):
+ assert self._in_context
+ self._in_context = False
self.stop()
self.join()
def start(self, flag=None):
+ if not self._in_context:
+ raise ValueError(
+ 'ThreadedEchoServer must be used as a context manager')
self.flag = flag
threading.Thread.start(self)
def run(self):
+ if not self._in_context:
+ raise ValueError(

View File

@@ -354,7 +354,7 @@ Fri Feb 23 01:06:42 UTC 2024 - Matej Cepl <mcepl@suse.com>
Tue Feb 20 22:14:02 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
- Remove double definition of /usr/bin/idle%%{version} in
%%files.
%%files.
-------------------------------------------------------------------
Thu Feb 15 10:29:07 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>