Remove deprecated pygtkcompat dependency from livedemo.py#442
Merged
Conversation
Replace pygtkcompat with modern PyGObject 3.x API to fix compatibility
with current PyGObject versions. The pygtkcompat module was removed
after PyGObject 3.50.x series and is no longer available.
Changes:
- Remove pygtkcompat import and enable calls
- Add gi.require_version('Gtk', '3.0') requirement
- Update GTK API calls to use Gtk.* instead of gtk.*
- Update wrap mode constant to Gtk.WrapMode.WORD
- Update main loop call to Gtk.main()
Fixes Debian bug #1118277
dhdaines
approved these changes
Oct 23, 2025
Contributor
dhdaines
left a comment
There was a problem hiding this comment.
Hmm! I don't think I wrote this code, or if I did I don't have any memory of it. Seems highly unlikely that anyone would need to support an old version of GTK at this point.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #440 - Remove deprecated pygtkcompat dependency from gst/livedemo.py
As reported in Debian bug #1118277, the
gst/livedemo.pyfile relies onpygtkcompat, which was removed after PyGObject 3.50.x series.Changes Made
pygtkcompatimport and enable callsgi.require_version('Gtk', '3.0')requirementGtk.*instead ofgtk.*Gtk.WrapMode.WORDGtk.main()Verification Steps
python3 -m py_compile gst/livedemo.pypython3 -c "import gi; gi.require_version('Gst', '1.0'); gi.require_version('Gtk', '3.0'); from gi.repository import GObject, Gst, Gtk; print('PyGObject dependencies available')"The changes are minimal and maintain full functionality while removing the deprecated dependency.