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