|
1 | | -import sys |
2 | 1 | from pathlib import Path |
3 | 2 | from typing import Sequence |
4 | 3 | from typing import Union |
@@ -346,44 +345,18 @@ def test_chained_exceptions_no_reprcrash(self, testdir: Testdir, tw_mock) -> Non |
346 | 345 | from subprocess to main process creates an artificial exception, which ExceptionInfo |
347 | 346 | can't obtain the ReprFileLocation from. |
348 | 347 | """ |
349 | | - # somehow in Python 3.5 on Windows this test fails with: |
350 | | - # File "c:\...\3.5.4\x64\Lib\multiprocessing\connection.py", line 302, in _recv_bytes |
351 | | - # overlapped=True) |
352 | | - # OSError: [WinError 6] The handle is invalid |
353 | | - # |
354 | | - # so in this platform we opted to use a mock traceback which is identical to the |
355 | | - # one produced by the multiprocessing module |
356 | | - if sys.version_info[:2] <= (3, 5) and sys.platform.startswith("win"): |
357 | | - testdir.makepyfile( |
358 | | - """ |
359 | | - # equivalent of multiprocessing.pool.RemoteTraceback |
360 | | - class RemoteTraceback(Exception): |
361 | | - def __init__(self, tb): |
362 | | - self.tb = tb |
363 | | - def __str__(self): |
364 | | - return self.tb |
365 | | - def test_a(): |
366 | | - try: |
367 | | - raise ValueError('value error') |
368 | | - except ValueError as e: |
369 | | - # equivalent to how multiprocessing.pool.rebuild_exc does it |
370 | | - e.__cause__ = RemoteTraceback('runtime error') |
371 | | - raise e |
| 348 | + testdir.makepyfile( |
372 | 349 | """ |
373 | | - ) |
374 | | - else: |
375 | | - testdir.makepyfile( |
376 | | - """ |
377 | | - from concurrent.futures import ProcessPoolExecutor |
| 350 | + from concurrent.futures import ProcessPoolExecutor |
378 | 351 |
|
379 | | - def func(): |
380 | | - raise ValueError('value error') |
| 352 | + def func(): |
| 353 | + raise ValueError('value error') |
381 | 354 |
|
382 | | - def test_a(): |
383 | | - with ProcessPoolExecutor() as p: |
384 | | - p.submit(func).result() |
385 | | - """ |
386 | | - ) |
| 355 | + def test_a(): |
| 356 | + with ProcessPoolExecutor() as p: |
| 357 | + p.submit(func).result() |
| 358 | + """ |
| 359 | + ) |
387 | 360 |
|
388 | 361 | testdir.syspathinsert() |
389 | 362 | reprec = testdir.inline_run() |
|
0 commit comments