Imported PyGObject's pygtkcompat.py for better compatibility