Detect Python even if python-gobject is missing

Reported by Anders F Björklund.