#!/usr/bin/python3
# To reproduce the bug: run and press Ctrl+C *twice*

from gi.repository import GLib
loop = GLib.MainLoop()

def start_loop():
	try:
		loop.run()
	except KeyboardInterrupt:
		try:
			if input('\nExit (y/n)? ') == 'y':
				loop.quit()
			else:
				start_loop()
		except KeyboardInterrupt:
			print('\nKeyboardInterrupt occured twice, exiting')
			loop.quit()

start_loop()
