File tree Expand file tree Collapse file tree 1 file changed +6
-18
lines changed
Expand file tree Collapse file tree 1 file changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -302,29 +302,17 @@ def do_zip_mods():
302302
303303def 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
330318def do_quietly (command ):
You can’t perform that action at this time.
0 commit comments