Skip to content

Commit f6ebd83

Browse files
authored
bpo-30871: pythoninfo: add expat and _decimal (#3121)
* bpo-30871: pythoninfo: add expat and _decimal * Remove _decimal.__version__ The string is hardcoded, not really interesting.
1 parent f1ff2c4 commit f6ebd83

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Lib/test/pythoninfo.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,26 @@ def collect_zlib(info_add):
345345
copy_attributes(info_add, zlib, 'zlib.%s', attributes)
346346

347347

348+
def collect_expat(info_add):
349+
try:
350+
from xml.parsers import expat
351+
except ImportError:
352+
return
353+
354+
attributes = ('EXPAT_VERSION',)
355+
copy_attributes(info_add, expat, 'expat.%s', attributes)
356+
357+
358+
def collect_decimal(info_add):
359+
try:
360+
import _decimal
361+
except ImportError:
362+
return
363+
364+
attributes = ('__libmpdec_version__',)
365+
copy_attributes(info_add, _decimal, '_decimal.%s', attributes)
366+
367+
348368
def collect_info(info):
349369
error = False
350370
info_add = info.add
@@ -365,6 +385,8 @@ def collect_info(info):
365385
collect_time,
366386
collect_tkinter,
367387
collect_zlib,
388+
collect_expat,
389+
collect_decimal,
368390
):
369391
try:
370392
collect_func(info_add)

0 commit comments

Comments
 (0)