File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 2
2
Collect various informations about Python to help debugging test failures.
3
3
"""
4
4
from __future__ import print_function
5
+ import errno
5
6
import re
6
7
import sys
7
8
import traceback
@@ -223,11 +224,17 @@ def format_attr(attr, value):
223
224
if hasattr (os , 'getrandom' ):
224
225
# PEP 524: Check if system urandom is initialized
225
226
try :
226
- os .getrandom (1 , os .GRND_NONBLOCK )
227
- state = 'ready (initialized)'
228
- except BlockingIOError as exc :
229
- state = 'not seeded yet (%s)' % exc
230
- info_add ('os.getrandom' , state )
227
+ try :
228
+ os .getrandom (1 , os .GRND_NONBLOCK )
229
+ state = 'ready (initialized)'
230
+ except BlockingIOError as exc :
231
+ state = 'not seeded yet (%s)' % exc
232
+ info_add ('os.getrandom' , state )
233
+ except OSError as exc :
234
+ # Python was compiled on a more recent Linux version
235
+ # than the current Linux kernel: ignore OSError(ENOSYS)
236
+ if exc .errno != errno .ENOSYS :
237
+ raise
231
238
232
239
233
240
def collect_readline (info_add ):
You can’t perform that action at this time.
0 commit comments