(info_add)
| 388 | |
| 389 | |
| 390 | def collect_readline(info_add): |
| 391 | try: |
| 392 | import readline |
| 393 | except ImportError: |
| 394 | return |
| 395 | |
| 396 | def format_attr(attr, value): |
| 397 | if isinstance(value, int): |
| 398 | return "%#x" % value |
| 399 | else: |
| 400 | return value |
| 401 | |
| 402 | attributes = ( |
| 403 | "_READLINE_VERSION", |
| 404 | "_READLINE_RUNTIME_VERSION", |
| 405 | "_READLINE_LIBRARY_VERSION", |
| 406 | ) |
| 407 | copy_attributes(info_add, readline, 'readline.%s', attributes, |
| 408 | formatter=format_attr) |
| 409 | |
| 410 | if not hasattr(readline, "_READLINE_LIBRARY_VERSION"): |
| 411 | # _READLINE_LIBRARY_VERSION has been added to CPython 3.7 |
| 412 | doc = getattr(readline, '__doc__', '') |
| 413 | if 'libedit readline' in doc: |
| 414 | info_add('readline.library', 'libedit readline') |
| 415 | elif 'GNU readline' in doc: |
| 416 | info_add('readline.library', 'GNU readline') |
| 417 | |
| 418 | |
| 419 | def collect_gdb(info_add): |
nothing calls this directly
no test coverage detected