Skip to content

Commit a871329

Browse files
edymttshahmishal
authored andcommitted
Use collections.abc.Iterable instead of collection.Iterable
The latter is no longer present in Python 3.10+. Addresses #58714 (cherry picked from commit ed69624)
1 parent 11e3d00 commit a871329

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

utils/build_swift/build_swift/shell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def quote(command):
208208
if isinstance(command, (str,)):
209209
return _quote(command)
210210

211-
if isinstance(command, collections.Iterable):
211+
if isinstance(command, collections.abc.Iterable):
212212
return ' '.join([_quote(arg) for arg in _normalize_args(command)])
213213

214214
raise ValueError('Invalid command type: {}'.format(type(command).__name__))

utils/build_swift/tests/build_swift/test_shell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def duplicate(x):
6767

6868
result = shell._flatmap(duplicate, [1, 2, 3])
6969

70-
self.assertIsInstance(result, collections.Iterable)
70+
self.assertIsInstance(result, collections.abc.Iterable)
7171
self.assertEqual(list(result), [1, 1, 2, 2, 3, 3])
7272

7373
# -------------------------------------------------------------------------

0 commit comments

Comments
 (0)