mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-31370: Remove support for threads-less builds (#3385)
* Remove Setup.config * Always define WITH_THREAD for compatibility.
This commit is contained in:
parent
1f06a680de
commit
a6a4dc816d
135 changed files with 2472 additions and 4377 deletions
|
@ -28,6 +28,7 @@ import pickle
|
|||
import random
|
||||
import signal
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
import unittest
|
||||
import warnings
|
||||
|
@ -40,10 +41,6 @@ from test.support.script_helper import assert_python_ok, run_python_until_end
|
|||
import codecs
|
||||
import io # C implementation of io
|
||||
import _pyio as pyio # Python implementation of io
|
||||
try:
|
||||
import threading
|
||||
except ImportError:
|
||||
threading = None
|
||||
|
||||
try:
|
||||
import ctypes
|
||||
|
@ -443,8 +440,6 @@ class IOTest(unittest.TestCase):
|
|||
(self.BytesIO, "rws"), (self.StringIO, "rws"),
|
||||
)
|
||||
for [test, abilities] in tests:
|
||||
if test is pipe_writer and not threading:
|
||||
continue # Skip subtest that uses a background thread
|
||||
with self.subTest(test), test() as obj:
|
||||
readable = "r" in abilities
|
||||
self.assertEqual(obj.readable(), readable)
|
||||
|
@ -1337,7 +1332,6 @@ class BufferedReaderTest(unittest.TestCase, CommonBufferedTests):
|
|||
|
||||
self.assertEqual(b"abcdefg", bufio.read())
|
||||
|
||||
@unittest.skipUnless(threading, 'Threading required for this test.')
|
||||
@support.requires_resource('cpu')
|
||||
def test_threads(self):
|
||||
try:
|
||||
|
@ -1664,7 +1658,6 @@ class BufferedWriterTest(unittest.TestCase, CommonBufferedTests):
|
|||
with self.open(support.TESTFN, "rb", buffering=0) as f:
|
||||
self.assertEqual(f.read(), b"abc")
|
||||
|
||||
@unittest.skipUnless(threading, 'Threading required for this test.')
|
||||
@support.requires_resource('cpu')
|
||||
def test_threads(self):
|
||||
try:
|
||||
|
@ -3053,7 +3046,6 @@ class TextIOWrapperTest(unittest.TestCase):
|
|||
self.assertEqual(f.errors, "replace")
|
||||
|
||||
@support.no_tracing
|
||||
@unittest.skipUnless(threading, 'Threading required for this test.')
|
||||
def test_threads_write(self):
|
||||
# Issue6750: concurrent writes could duplicate data
|
||||
event = threading.Event()
|
||||
|
@ -3804,7 +3796,6 @@ class CMiscIOTest(MiscIOTest):
|
|||
b = bytearray(2)
|
||||
self.assertRaises(ValueError, bufio.readinto, b)
|
||||
|
||||
@unittest.skipUnless(threading, 'Threading required for this test.')
|
||||
def check_daemon_threads_shutdown_deadlock(self, stream_name):
|
||||
# Issue #23309: deadlocks at shutdown should be avoided when a
|
||||
# daemon thread and the main thread both write to a file.
|
||||
|
@ -3868,7 +3859,6 @@ class SignalsTest(unittest.TestCase):
|
|||
def alarm_interrupt(self, sig, frame):
|
||||
1/0
|
||||
|
||||
@unittest.skipUnless(threading, 'Threading required for this test.')
|
||||
def check_interrupted_write(self, item, bytes, **fdopen_kwargs):
|
||||
"""Check that a partial write, when it gets interrupted, properly
|
||||
invokes the signal handler, and bubbles up the exception raised
|
||||
|
@ -3990,7 +3980,6 @@ class SignalsTest(unittest.TestCase):
|
|||
self.check_interrupted_read_retry(lambda x: x,
|
||||
mode="r")
|
||||
|
||||
@unittest.skipUnless(threading, 'Threading required for this test.')
|
||||
def check_interrupted_write_retry(self, item, **fdopen_kwargs):
|
||||
"""Check that a buffered write, when it gets interrupted (either
|
||||
returning a partial result or EINTR), properly invokes the signal
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue