From 65f97e4d8bdf60ad55f336ef97f913dd88ffdfe5 Mon Sep 17 00:00:00 2001 From: FW Date: Mon, 25 Feb 2019 15:16:34 +0100 Subject: [PATCH] Add deprecation note for gamedata change --- sc2/units.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sc2/units.py b/sc2/units.py index f8ab3f74..58be8f83 100644 --- a/sc2/units.py +++ b/sc2/units.py @@ -17,10 +17,16 @@ class Units(list): # Add keyword argument 'game_data=None' to provide downwards # compatibility for bots that use '__init__' or 'from_proto' functions. @classmethod - def from_proto(cls, units): # game_data=None + def from_proto(cls, units, game_data=None): # game_data=None + if game_data: + logger.info("Keyword argument 'game_data' in Units classmethod 'from_proto' is deprecated.") + logger.info("You can safely remove it.") return cls((Unit(u) for u in units)) - def __init__(self, units): # game_data=None + def __init__(self, units, game_data=None): + if game_data: + logger.info("Keyword argument 'game_data' in Units function '__init__' is deprecated.") + logger.info("You can safely remove it.") super().__init__(units) def __call__(self, *args, **kwargs):