Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Gtk = None
from asyncio import events
from asyncio import futures
from asyncio import tasks
from asyncio.log import logger
from . import unix_events
import threading
import signal
import weakref
import collections
import os
class GLibChildWatcher(unix_events.AbstractChildWatcher):
def __init__(self):
self._sources = {}
def attach_loop(self, loop):
# just ignored
pass
def add_child_handler(self, pid, callback, *args):
self.remove_child_handler(pid)
source = GLib.child_watch_add(0, pid, self._glib_callback)
self._sources[pid] = source, callback, args
def remove_child_handler(self, pid):
try:
source = self._sources.pop(pid)[0]