mirror of
https://github.com/python/cpython.git
synced 2025-07-28 05:34:31 +00:00
change threading.getIdent to a property
This is new in 2.6 so now need to worry about backwards compatibility :)
This commit is contained in:
parent
e5bdccc77b
commit
d8a8972ca9
4 changed files with 9 additions and 8 deletions
|
@ -73,7 +73,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()
|
||||
|
||||
|
@ -82,7 +82,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'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue