Skip to content

Commit ed69624

Browse files
committed
Use collections.abc.Iterable instead of collection.Iterable
The latter is no longer present in Python 3.10+. Addresses #58714
1 parent 298083d commit ed69624

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
@@ -206,7 +206,7 @@ def quote(command):
206206
if isinstance(command, (str,)):
207207
return _quote(command)
208208

209-
if isinstance(command, collections.Iterable):
209+
if isinstance(command, collections.abc.Iterable):
210210
return ' '.join([_quote(arg) for arg in _normalize_args(command)])
211211

212212
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
@@ -65,7 +65,7 @@ def duplicate(x):
6565

6666
result = shell._flatmap(duplicate, [1, 2, 3])
6767

68-
self.assertIsInstance(result, collections.Iterable)
68+
self.assertIsInstance(result, collections.abc.Iterable)
6969
self.assertEqual(list(result), [1, 1, 2, 2, 3, 3])
7070

7171
# -------------------------------------------------------------------------

0 commit comments

Comments
 (0)