Skip to content

Commit 183cd9b

Browse files
committed
build: tweaks to how the python build is bannered for tox
1 parent 6c2fb87 commit 183cd9b

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

igor.py

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -302,29 +302,17 @@ def do_zip_mods():
302302

303303
def print_banner(label):
304304
"""Print the version of Python."""
305-
try:
306-
impl = platform.python_implementation()
307-
except AttributeError:
308-
impl = "Python"
309-
305+
impl = platform.python_implementation()
310306
version = platform.python_version()
311-
307+
has_gil = getattr(sys, '_is_gil_enabled', lambda: True)()
308+
if not has_gil:
309+
version += "t"
312310
if PYPY:
313311
version += " (pypy %s)" % ".".join(str(v) for v in sys.pypy_version_info)
314-
315312
version += f" ({' '.join(platform.python_build())})"
313+
version += " (gil)" if has_gil else " (nogil)"
316314

317-
gil = "gil" if getattr(sys, '_is_gil_enabled', lambda: True)() else "nogil"
318-
version += f" ({gil})"
319-
320-
try:
321-
which_python = os.path.relpath(sys.executable)
322-
except ValueError:
323-
# On Windows having a python executable on a different drive
324-
# than the sources cannot be relative.
325-
which_python = sys.executable
326-
print(f"=== {impl} {version} {label} ({which_python}) ===")
327-
sys.stdout.flush()
315+
print(f"=== {impl} {version} {label} ({sys.base_prefix}) ===", flush=True)
328316

329317

330318
def do_quietly(command):

0 commit comments

Comments
 (0)