8000 bpo-29854: Print readline version information when running test suite by berkerpeksag · Pull Request #2618 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-29854: Print readline version information when running test suite #2618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Lib/test/libregrtest/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import platform
import random
import re
import subprocess
import sys
import sysconfig
import tempfile
Expand Down Expand Up @@ -432,6 +433,23 @@ def display_header(self):
print("== encodings: locale=%s, FS=%s"
% (locale.getpreferredencoding(False),
sys.getfilesystemencoding()))
rl_version_cmd = textwrap.dedent("""
import sys
try:
import readline
except ImportError:
sys.exit(1)
else:
def get_rl_info():
is_editline = readline.__doc__ and "libedit" in readline.__doc__
return f"{readline._READLINE_VERSION:#06x}", "editline" if is_editline else "GNU readline"
rl_version, rl_implementation = get_rl_info()
print(f"== readline: version {rl_version} ({rl_implementation})", end="")
""")
rl_output = subprocess.run([sys.executable, "-c", rl_version_cmd],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if rl_output.returncode == 0:
print(rl_output.stdout.decode())
print("Testing with flags:", sys.flags)

def run_tests(self):
Expand Down
0