pygobject / pgi

[Unmaintained: Use PyGObject instead] GTK+ / GObject Introspection Bindings for PyPy.
GNU Lesser General Public License v2.1
74 stars 16 forks source link

Ctrl+C interupt not working #42

Open susundberg opened 6 years ago

susundberg commented 6 years ago

Hi!

I ended up to this wonderfull library while trying to get dbus - service loop up-n-running inside virtual enviroment.

The issue is on: https://github.com/pygobject/pgi/blob/3f83489d051a0a5c7527266688b353bec3b55106/pgi/overrides/GLib.py#L613

Error given:

  File "_ctypes/callbacks.c", line 234, in 'calling callback function'
  File "<string>", line 3, in SourceFunc
  File "/home/salmenrinne/PEX/pex-scanning-proto/ENV/lib/python3.6/site-packages/pgi/overrides/GLib.py", line 551, in _handler
    loop.quit()
AttributeError: 'NoneType' object has no attribute 'quit'

Fixes the issue:

            self.quit()
            self._quit_by_sigint = True

Package installed from pip:

Name: pgi
Version: 0.0.11.1
Summary: Pure Python GObject Introspection Bindings
Home-page: https://github.com/lazka/pgi
Author: Christoph Reiter
Author-email: reiter.christoph@gmail.com
License: LGPL-2.1+

Python: Python 3.6.3 (default, Oct 3 2017, 21:45:48)

Should i make pull request or is the setup invalid?