diff options
author | Arjan Molenaar <gaphor@gmail.com> | 2021-11-03 21:39:42 +0100 |
---|---|---|
committer | Christoph Reiter <reiter.christoph@gmail.com> | 2022-03-27 15:35:23 +0200 |
commit | ad3c274d12b93a594571714b1800f20639a46cf6 (patch) | |
tree | 628e5081f32200f1f29b3709fecc77a63b43141a /gi/overrides/Gtk.py | |
parent | 8ea38cd186f5e33d8e328a8b66180f7ca83abedc (diff) | |
download | pygobject-ad3c274d12b93a594571714b1800f20639a46cf6.tar.gz |
Only create function _construct_target_list for GTK2/3
It's not used in GTK 4.
Diffstat (limited to 'gi/overrides/Gtk.py')
-rw-r--r-- | gi/overrides/Gtk.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py index d9ec6fbe..6ddc12f6 100644 --- a/gi/overrides/Gtk.py +++ b/gi/overrides/Gtk.py @@ -64,21 +64,21 @@ class PyGTKDeprecationWarning(PyGIDeprecationWarning): __all__.append('PyGTKDeprecationWarning') -def _construct_target_list(targets): - """Create a list of TargetEntry items from a list of tuples in the form (target, flags, info) - - The list can also contain existing TargetEntry items in which case the existing entry - is re-used in the return list. - """ - target_entries = [] - for entry in targets: - if not isinstance(entry, Gtk.TargetEntry): - entry = Gtk.TargetEntry.new(*entry) - target_entries.append(entry) - return target_entries - +if GTK2 or GTK3: + def _construct_target_list(targets): + """Create a list of TargetEntry items from a list of tuples in the form (target, flags, info) -__all__.append('_construct_target_list') + The list can also contain existing TargetEntry items in which case the existing entry + is re-used in the return list. + """ + target_entries = [] + for entry in targets: + if not isinstance(entry, Gtk.TargetEntry): + entry = Gtk.TargetEntry.new(*entry) + target_entries.append(entry) + return target_entries + + __all__.append('_construct_target_list') def _builder_connect_callback(builder, gobj, signal_name, handler_name, connect_obj, flags, obj_or_map): |