Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdf4f0fe

Browse files
authored
gh-109276: Complete test.pythoninfo (#109312)
* Enable collect_sysconfig() on Windows.* Add sysconfig 'abs_builddir' and 'srcdir'* Add sysconfig.is_python_build()* Add tempfile.gettempdir()* Remove compatiblity with Python 2.7 (print_function).
1 parent9363769 commitdf4f0fe

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

‎Lib/test/pythoninfo.py‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
"""
22
Collect various information about Python to help debugging test failures.
33
"""
4-
from __future__importprint_function
54
importerrno
65
importre
76
importsys
87
importtraceback
9-
importunittest
108
importwarnings
119

1210

13-
MS_WINDOWS= (sys.platform=='win32')
14-
15-
1611
defnormalize_text(text):
1712
iftextisNone:
1813
returnNone
@@ -493,13 +488,10 @@ def collect_datetime(info_add):
493488

494489

495490
defcollect_sysconfig(info_add):
496-
# On Windows, sysconfig is not reliable to get macros used
497-
# to build Python
498-
ifMS_WINDOWS:
499-
return
500-
501491
importsysconfig
502492

493+
info_add('sysconfig.is_python_build',sysconfig.is_python_build())
494+
503495
fornamein (
504496
'ABIFLAGS',
505497
'ANDROID_API_LEVEL',
@@ -523,7 +515,9 @@ def collect_sysconfig(info_add):
523515
'Py_NOGIL',
524516
'SHELL',
525517
'SOABI',
518+
'abs_builddir',
526519
'prefix',
520+
'srcdir',
527521
):
528522
value=sysconfig.get_config_var(name)
529523
ifname=='ANDROID_API_LEVEL'andnotvalue:
@@ -711,6 +705,7 @@ def collect_resource(info_add):
711705

712706

713707
defcollect_test_socket(info_add):
708+
importunittest
714709
try:
715710
fromtestimporttest_socket
716711
except (ImportError,unittest.SkipTest):
@@ -896,6 +891,11 @@ def collect_fips(info_add):
896891
pass
897892

898893

894+
defcollect_tempfile(info_add):
895+
importtempfile
896+
897+
info_add('tempfile.gettempdir',tempfile.gettempdir())
898+
899899
defcollect_info(info):
900900
error=False
901901
info_add=info.add
@@ -930,6 +930,7 @@ def collect_info(info):
930930
collect_sysconfig,
931931
collect_testcapi,
932932
collect_testinternalcapi,
933+
collect_tempfile,
933934
collect_time,
934935
collect_tkinter,
935936
collect_windows,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp