MCPcopy Index your code
hub / github.com/python/cpython / collect_readline

Function collect_readline

Lib/test/pythoninfo.py:396–422  ·  view source on GitHub ↗
(info_add)

Source from the content-addressed store, hash-verified

394
395
396def 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
425def collect_gdb(info_add):

Callers

nothing calls this directly

Calls 1

copy_attributesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…