fix for ValueError raised in faulthandler teardown code
Fixes https://github.com/pytest-dev/pytest/issues/11439
This commit is contained in:
parent
5e081162df
commit
ea16d16c0a
1
AUTHORS
1
AUTHORS
|
@ -346,6 +346,7 @@ Serhii Mozghovyi
|
|||
Seth Junot
|
||||
Shantanu Jain
|
||||
Shubham Adep
|
||||
Simon Blanchard
|
||||
Simon Gomizelj
|
||||
Simon Holesch
|
||||
Simon Kerr
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Fix for ValueError exception being raised in faulthandler teardown code.
|
|
@ -1,4 +1,3 @@
|
|||
import io
|
||||
import os
|
||||
import sys
|
||||
from typing import Generator
|
||||
|
@ -51,7 +50,7 @@ def get_stderr_fileno() -> int:
|
|||
if fileno == -1:
|
||||
raise AttributeError()
|
||||
return fileno
|
||||
except (AttributeError, io.UnsupportedOperation):
|
||||
except (AttributeError, ValueError):
|
||||
# pytest-xdist monkeypatches sys.stderr with an object that is not an actual file.
|
||||
# https://docs.python.org/3/library/faulthandler.html#issue-with-file-descriptors
|
||||
# This is potentially dangerous, but the best we can do.
|
||||
|
|
Loading…
Reference in New Issue