diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-08-18 16:45:31 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-08-18 16:45:31 (GMT) |
commit | 773c17b3e107a23c131974f71d3e2f145ee5203d (patch) | |
tree | b299a18fa2b9043d76a05edc785a8d9a30e8a53c /Lib | |
parent | 46f5f9ee0fe359100fdd7c84bd4a3b4a61a4c98f (diff) | |
download | cpython-773c17b3e107a23c131974f71d3e2f145ee5203d.zip cpython-773c17b3e107a23c131974f71d3e2f145ee5203d.tar.gz cpython-773c17b3e107a23c131974f71d3e2f145ee5203d.tar.bz2 |
Merged revisions 65818 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r65818 | benjamin.peterson | 2008-08-18 11:40:03 -0500 (Mon, 18 Aug 2008) | 4 lines
change threading.getIdent to a property
This is new in 2.6 so now need to worry about backwards compatibility :)
........
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_threading.py | 4 | ||||
-rw-r--r-- | Lib/threading.py | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 1abc63f..0a49297 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -74,7 +74,7 @@ class ThreadTests(unittest.TestCase): for i in range(NUMTASKS): t = TestThread("<thread %d>"%i, self, sema, mutex, numrunning) threads.append(t) - self.failUnlessEqual(t.get_ident(), None) + self.failUnlessEqual(t.ident, None) self.assert_(re.match('<TestThread\(.*, initial\)>', repr(t))) t.start() @@ -83,7 +83,7 @@ class ThreadTests(unittest.TestCase): for t in threads: t.join(NUMTASKS) self.assert_(not t.is_alive()) - self.failIfEqual(t.get_ident(), 0) + self.failIfEqual(t.ident, 0) self.assert_(re.match('<TestThread\(.*, \w+ -?\d+\)>', repr(t))) if verbose: print('all tasks done') diff --git a/Lib/threading.py b/Lib/threading.py index 4832101..ccbd67e 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -629,7 +629,8 @@ class Thread(_Verbose): assert self._initialized, "Thread.__init__() not called" self._name = str(name) - def get_ident(self): + @property + def ident(self): assert self._initialized, "Thread.__init__() not called" return self._ident |