blob: 901ea6414e8bc80b6878f3c0c5b81d2a583be8bb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
--- a/horizons/ai/aiplayer/combat/unitmanager.py 2019-01-12 16:15:42.000000000 +0100
+++ b/horizons/ai/aiplayer/combat/unitmanager.py 2022-09-04 03:17:12.660088944 +0200
@@ -151,7 +151,7 @@
"""
Rule stating that ship has to be in any of given states.
"""
- if not isinstance(ship_states, collections.Iterable):
+ if not isinstance(ship_states, collections.abc.Iterable):
ship_states = (ship_states,)
return lambda ship: (state_dict[ship] in ship_states)
@@ -178,7 +178,7 @@
@param rules: conditions each ship has to meet (AND)
@type rules: iterable of lambda(ship) or single lambda(ship)
"""
- if not isinstance(rules, collections.Iterable):
+ if not isinstance(rules, collections.abc.Iterable):
rules = (rules,)
return [ship for ship in ships if all((rule(ship) for rule in rules))]
|