Skip to content

Conversation

@dmzoneill
Copy link

Summary

Fixes #560

This PR resolves PyGTK deprecation warnings in nemo-terminal by updating widget constructors to use keyword arguments instead of deprecated positional arguments.

Problem

When running nemo-terminal, the following deprecation warnings appear:

PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. 
Please specify keyword(s) for "label" or use a class specific constructor.

These warnings occur at:

  • Line 22: Gtk.Label(label)
  • Line 208: Gtk.Button(_("Restore defaults"))

Solution

Updated the deprecated constructors to use keyword arguments:

Before After
Gtk.Label(label) Gtk.Label(label=label)
Gtk.Button(_("Restore defaults")) Gtk.Button(label=_("Restore defaults"))

Changes

  • Modified nemo-terminal/src/nemo-terminal-prefs.py:
    • Line 22: Updated Gtk.Label constructor
    • Line 208: Updated Gtk.Button constructor

Testing

The changes follow the migration guide from the PyGObject deprecation warnings:
https://wiki.gnome.org/Projects/PyGObject/InitializerDeprecations

After this fix:

  • No deprecation warnings are shown when using nemo-terminal
  • Widget initialization works exactly as before
  • Code follows modern PyGObject best practices

Automated contribution via github-ai-contributor

linuxmint#560)

Updated Gtk.Label and Gtk.Button constructors to use keyword arguments
instead of positional arguments to resolve PyGTKDeprecationWarning.

Changes:
- Gtk.Label(label) → Gtk.Label(label=label)
- Gtk.Button(_("Restore defaults")) → Gtk.Button(label=_("Restore defaults"))

This eliminates the following warnings:
  PyGTKDeprecationWarning: Using positional arguments with the GObject
  constructor has been deprecated. Please specify keyword(s) for "label"
  or use a class specific constructor.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nemo-terminal python deprecated warning

1 participant