diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2017-08-17 20:13:11 (GMT) | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-17 20:13:11 (GMT) | 
| commit | f6ebd838f00b4c211c72d85ee49749e910cd3afe (patch) | |
| tree | ac8296bc74bb94575860a6285ed92f5868ceff3e /Lib/test/pythoninfo.py | |
| parent | f1ff2c4b613ba7acc5d80e67d3c175d8443191b1 (diff) | |
| download | cpython-f6ebd838f00b4c211c72d85ee49749e910cd3afe.zip cpython-f6ebd838f00b4c211c72d85ee49749e910cd3afe.tar.gz cpython-f6ebd838f00b4c211c72d85ee49749e910cd3afe.tar.bz2  | |
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.
Diffstat (limited to 'Lib/test/pythoninfo.py')
| -rw-r--r-- | Lib/test/pythoninfo.py | 22 | 
1 files changed, 22 insertions, 0 deletions
diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index 03081b6..e054113 100644 --- a/Lib/test/pythoninfo.py +++ b/Lib/test/pythoninfo.py @@ -345,6 +345,26 @@ def collect_zlib(info_add):      copy_attributes(info_add, zlib, 'zlib.%s', attributes) +def collect_expat(info_add): +    try: +        from xml.parsers import expat +    except ImportError: +        return + +    attributes = ('EXPAT_VERSION',) +    copy_attributes(info_add, expat, 'expat.%s', attributes) + + +def collect_decimal(info_add): +    try: +        import _decimal +    except ImportError: +        return + +    attributes = ('__libmpdec_version__',) +    copy_attributes(info_add, _decimal, '_decimal.%s', attributes) + +  def collect_info(info):      error = False      info_add = info.add @@ -365,6 +385,8 @@ def collect_info(info):          collect_time,          collect_tkinter,          collect_zlib, +        collect_expat, +        collect_decimal,      ):          try:              collect_func(info_add)  | 
