[pygobject/benzea/gio-asyncio] test




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

    test

 gi/events.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/gi/events.py b/gi/events.py
index 76a942b4..e032aadf 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]
@@ -380,7 +387,7 @@ class _Source(GLib.Source):
         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]