diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-08-18 21:53:29 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-08-18 21:53:29 (GMT) |
commit | 6ee1a31e9ba8c7e1ad33ed65440a9626886df345 (patch) | |
tree | 0aa90d08a0540a54b8c709fb58b3b6422359a072 /Lib/threading.py | |
parent | 351ffb80c3fffc2996cc320fd9e0eaf3778eba25 (diff) | |
download | cpython-6ee1a31e9ba8c7e1ad33ed65440a9626886df345.zip cpython-6ee1a31e9ba8c7e1ad33ed65440a9626886df345.tar.gz cpython-6ee1a31e9ba8c7e1ad33ed65440a9626886df345.tar.bz2 |
add py3k warnings for old threading APIs
they will still live in 3.0 but it can't hurt
Diffstat (limited to 'Lib/threading.py')
-rw-r--r-- | Lib/threading.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Lib/threading.py b/Lib/threading.py index a6522d6..4933cab 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -39,7 +39,7 @@ def _old_api(callable, old_name): return callable @wraps(callable) def old(*args, **kwargs): - warnings.warnpy3k("In 3.x, {0} is renamed to {1}." + warnings.warnpy3k("{0}() is deprecated in favor of {1}()" .format(old_name, callable.__name__), stacklevel=3) return callable(*args, **kwargs) @@ -670,6 +670,8 @@ class Thread(_Verbose): assert self.__initialized, "Thread.__init__() not called" return self.__started.is_set() and not self.__stopped + isAlive = _old_api(is_alive, "isAlive") + @property def daemon(self): assert self.__initialized, "Thread.__init__() not called" @@ -684,15 +686,23 @@ class Thread(_Verbose): self.__daemonic = daemonic def isDaemon(self): + warnings.warnpy3k("isDaemon() is deprecated in favor of the " \ + "Thread.daemon property") return self.daemon def setDaemon(self, daemonic): + warnings.warnpy3k("setDaemon() is deprecated in favor of the " \ + "Thread.daemon property") self.daemon = daemonic def getName(self): + warnings.warnpy3k("getName() is deprecated in favor of the " \ + "Thread.name property") return self.name def setName(self, name): + warnings.warnpy3k("setName() is deprecated in favor of the " \ + "Thread.name property") self.name = name # The timer class was contributed by Itamar Shtull-Trauring |