@inputhook_manager.register('gevent') class GeventInputHook(object): def __init__(self, manager): self.manager = manager def enable(self, app=None): """Enable event loop integration with gevent. Parameters ---------- app : ignored Ignored, it's only a placeholder to keep the call signature of all gui activation methods consistent, which simplifies the logic of supporting magics. Notes ----- This methods sets the PyOS_InputHook for gevent, which allows gevent greenlets to run in the background while interactively using IPython. """ self.manager.set_inputhook(inputhook_gevent) self._current_gui = GUI_GEVENT return app def disable(self): """Disable event loop integration with gevent. This merely sets PyOS_InputHook to NULL. """ self.manager.clear_inputhook()
at the first line. Commenting it out allows the code to run, but is it possible to avoid altering the code?