Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(21)

Unified Diff: Lib/test/test_threaded_import.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_tarfile.py ('k') | Lib/test/test_threading.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_threaded_import.py Tue Jul 26 09:37:46 2011 +0300
+++ b/Lib/test/test_threaded_import.py Mon Jul 25 09:47:18 2011 -0400
@@ -11,8 +11,8 @@
import time
import shutil
import unittest
-from test.support import (
- verbose, import_module, run_unittest, TESTFN, reap_threads)
+from test.support import verbose, import_module, run_unittest, TESTFN
+thread = import_module('_thread')
threading = import_module('threading')
def task(N, done, done_tasks, errors):
@@ -62,7 +62,7 @@
def __init__(self):
self.numcalls = 0
self.x = 0
- self.lock = threading.Lock()
+ self.lock = thread.allocate_lock()
def find_module(self, name, path=None):
# Simulate some thread-unsafe behaviour. If calls to find_module()
@@ -113,9 +113,7 @@
done_tasks = []
done.clear()
for i in range(N):
- t = threading.Thread(target=task,
- args=(N, done, done_tasks, errors,))
- t.start()
+ thread.start_new_thread(task, (N, done, done_tasks, errors,))
done.wait(60)
self.assertFalse(errors)
if verbose:
@@ -205,7 +203,6 @@
self.assertEqual(set(results), {'a', 'b'})
-@reap_threads
def test_main():
run_unittest(ThreadedImportTests)
« no previous file with comments | « Lib/test/test_tarfile.py ('k') | Lib/test/test_threading.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+