[pygobject/benzea/gio-asyncio] test



commit 8c884d2f67896bfd21048b4329d11d7823a0564d
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..ba35ccec 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,6 +259,7 @@ 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
@@ -261,6 +267,7 @@ class GLibEventLoopPolicy(events.AbstractEventLoopPolicy):
         self._loops[ctx] = GLibEventLoop(ctx)
         if self._child_watcher and ctx == GLib.MainContext.default():
             self._child_watcher.attach_loop(self.get_event_loop())
+        print(f"got new loop {self._loops[ctx]}")
         return self._loops[ctx]
 
     def set_event_loop(self, loop):
@@ -380,7 +387,7 @@ class _Source(GLib.Source):
         return bool(ready)
 
     def dispatch(self, callback, args):
-        print("dispatching")
+        print(f"dispatching {hash(self._loop()):X}" )
         # 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]