File remove_six.patch of Package gyp

---
 pylib/gyp/common.py          |    4 ++--
 pylib/gyp/generator/ninja.py |    6 +++---
 pylib/gyp/msvs_emulation.py  |    8 ++++----
 test/lib/TestGyp.py          |    4 ++--
 4 files changed, 11 insertions(+), 11 deletions(-)

Index: pylib/gyp/common.py
===================================================================
--- pylib/gyp/common.py.orig	2025-05-15 15:20:24.275233036 +0000
+++ pylib/gyp/common.py	2025-05-15 15:22:38.181375381 +0000
@@ -11,7 +11,7 @@
 import tempfile
 import sys
 
-from six.moves import collections_abc
+import collections.abc
 
 
 # A minimal memoizing decorator. It'll blow up if the args aren't immutable,
@@ -495,7 +495,7 @@
 
 
 # Based on http://code.activestate.com/recipes/576694/.
-class OrderedSet(collections_abc.MutableSet):
+class OrderedSet(collections.abc.MutableSet):
   def __init__(self, iterable=None):
     self.end = end = []
     end += [None, end, end]         # sentinel node for doubly linked list
Index: pylib/gyp/generator/ninja.py
===================================================================
--- pylib/gyp/generator/ninja.py.orig	2025-05-15 15:20:24.283474493 +0000
+++ pylib/gyp/generator/ninja.py	2025-05-15 15:22:38.181998072 +0000
@@ -14,7 +14,6 @@
 import signal
 import subprocess
 import sys
-import six
 import gyp
 import gyp.common
 from gyp.common import OrderedSet
@@ -750,9 +749,10 @@
 
         outputs = [self.GypPathToNinja(o, env) for o in outputs]
         if self.flavor == 'win':
+          b_output0 = outputs[0]
+          b_output0 = b_output0.encode(encoding, errors) if isinstance(b_output0, text_type) else b_output0
           # WriteNewNinjaRule uses unique_name for creating an rsp file on win.
-          extra_bindings.append(('unique_name',
-              hashlib.md5(six.ensure_binary(outputs[0])).hexdigest()))
+          extra_bindings.append(('unique_name', hashlib.md5(b_output0.hexdigest()))
 
         self.ninja.build(outputs, rule_name, self.GypPathToNinja(source),
                          implicit=inputs,
Index: pylib/gyp/msvs_emulation.py
===================================================================
--- pylib/gyp/msvs_emulation.py.orig	2025-05-15 15:20:24.276788693 +0000
+++ pylib/gyp/msvs_emulation.py	2025-05-15 15:22:38.182652794 +0000
@@ -12,7 +12,7 @@
 import subprocess
 import sys
 
-from six.moves import collections_abc
+import collections.abc
 
 from gyp.common import OrderedSet
 import gyp.MSVSUtil
@@ -94,7 +94,7 @@
   """Add |prefix| to |element| or each subelement if element is iterable."""
   if element is None:
     return element
-  if (isinstance(element, collections_abc.Iterable) and
+  if (isinstance(element, collections.abc.Iterable) and
       not isinstance(element, basestring)):
     return [prefix + e for e in element]
   else:
@@ -107,7 +107,7 @@
   if map is not None and element is not None:
     if not callable(map):
       map = map.get # Assume it's a dict, otherwise a callable to do the remap.
-    if (isinstance(element, collections_abc.Iterable) and
+    if (isinstance(element, collections.abc.Iterable) and
         not isinstance(element, basestring)):
       element = filter(None, [map(elem) for elem in element])
     else:
@@ -120,7 +120,7 @@
   then add |element| to it, adding each item in |element| if it's a list or
   tuple."""
   if append is not None and element is not None:
-    if (isinstance(element, collections_abc.Iterable) and
+    if (isinstance(element, collections.abc.Iterable) and
         not isinstance(element, basestring)):
       append.extend(element)
     else:
Index: test/lib/TestGyp.py
===================================================================
--- test/lib/TestGyp.py.orig	2024-02-07 13:51:09.000000000 +0000
+++ test/lib/TestGyp.py	2025-05-15 15:22:38.183126546 +0000
@@ -18,7 +18,7 @@
 
 from contextlib import contextmanager
 
-from six.moves import collections_abc
+import collections.abc
 
 import TestCmd
 import TestCommon
@@ -497,7 +497,7 @@
     if status is None:
       kw['status'] = None
     else:
-      if not isinstance(status, collections_abc.Iterable): status = (status,)
+      if not isinstance(status, collections.abc.Iterable): status = (status,)
       kw['status'] = list(itertools.chain((0,), status))
     self.cmake_build(gyp_file, target, **kw)
     kw['status'] = status
openSUSE Build Service is sponsored by