gtk-builder-convert-Remove-compat-code-for-Python-2.3-and.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From: Petr Viktorin <encukou@gmail.com>
  2. Date: Tue, 3 Sep 2019 14:53:05 +0200
  3. Subject: gtk-builder-convert: Remove compat code for Python 2.3 and below
  4. Origin: upstream, 2.24.33, commit:4f8efe3ae09ee69657b83399a118b5252f25d830
  5. ---
  6. gtk/gtk-builder-convert | 13 +------------
  7. 1 file changed, 1 insertion(+), 12 deletions(-)
  8. diff --git a/gtk/gtk-builder-convert b/gtk/gtk-builder-convert
  9. index 41f7a8c..a16f83b 100755
  10. --- a/gtk/gtk-builder-convert
  11. +++ b/gtk/gtk-builder-convert
  12. @@ -48,12 +48,7 @@ DIALOGS = ['GtkDialog',
  13. 'GtkMessageDialog']
  14. WINDOWS = ['GtkWindow'] + DIALOGS
  15. -# The subprocess is only available in Python 2.4+
  16. -try:
  17. - import subprocess
  18. - subprocess # pyflakes
  19. -except ImportError:
  20. - subprocess = None
  21. +import subprocess
  22. def get_child_nodes(node):
  23. assert node.tagName == 'object'
  24. @@ -271,12 +266,6 @@ class GtkBuilderConverter(object):
  25. for node in self._dom.getElementsByTagName("accessibility"):
  26. self._convert_accessibility(node)
  27. - # Output the newly created root objects and sort them
  28. - # by attribute id
  29. - # FIXME: Use sorted(self.root_objects,
  30. - # key=lambda n: n.getAttribute('id'),
  31. - # reverse=True):
  32. - # when we can depend on python 2.4 or higher
  33. root_objects = self.root_objects[:]
  34. root_objects.sort(key=lambda a: a.getAttribute('id'), reverse=True)
  35. for obj in root_objects: