[pygobject/benzea/gio-asyncio] test




commit ada351f8b07423ffb4e791849c2226dc9dee24ce
Author: Benjamin Berg <bberg redhat com>
Date:   Fri Nov 19 14:51:31 2021 +0100

    test

 gi/events.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/gi/events.py b/gi/events.py
index 76a942b4..3b910298 100644
--- a/gi/events.py
+++ b/gi/events.py
@@ -236,6 +236,11 @@ class GLibEventLoopPolicy(events.AbstractEventLoopPolicy):
         by calling set_event_loop().
 
         Returns a new GLibEventLoop or raises an exception."""
+
+        import traceback
+        print("getting loop")
+        traceback.print_stack(limit=5)
+
         # Get the thread default main context
         ctx = GLib.MainContext.get_thread_default()
         # If there is none, and we are on the main thread, then use the default context
@@ -254,11 +259,13 @@ class GLibEventLoopPolicy(events.AbstractEventLoopPolicy):
         try:
             loop = self._loops[ctx]
             if not loop.is_closed():
+                print(f"got existing loop {loop}")
                 return loop
         except KeyError:
             pass
 
         self._loops[ctx] = GLibEventLoop(ctx)
+        print(f"got new loop {self._loops[ctx]}")
         if self._child_watcher and ctx == GLib.MainContext.default():
             self._child_watcher.attach_loop(self.get_event_loop())
         return self._loops[ctx]
@@ -373,14 +380,14 @@ class _Source(GLib.Source):
 
         timeout = self._loop()._get_timeout_ms()
         if timeout == 0:
-            print("check returns ready due to timeout")
+            print(f"check returns ready due to timeout {self._loop()}")
             return True
 
-        print("checking with timeout", timeout)
+        print("checking with timeout", timeout, self._loop())
         return bool(ready)
 
     def dispatch(self, callback, args):
-        print("dispatching")
+        print(f"dispatching {self._loop()}" )
         # Now, wag the dog by its tail
         self._dispatching = True
         try:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]