mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.13] GH-121970: Modernise the patchlevel extension (GH-121995) (#122060)
GH-121970: Modernise the patchlevel extension (GH-121995)
(cherry picked from commit b7ad711fcb
)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
parent
1b4c5fe159
commit
efc7d1ca86
3 changed files with 66 additions and 58 deletions
|
@ -6,6 +6,7 @@
|
|||
# The contents of this file are pickled, so don't put values in the namespace
|
||||
# that aren't pickleable (module imports are okay, they're removed automatically).
|
||||
|
||||
import importlib
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
@ -64,9 +65,8 @@ copyright = f"2001-{time.strftime('%Y')}, Python Software Foundation"
|
|||
|
||||
# We look for the Include/patchlevel.h file in the current Python source tree
|
||||
# and replace the values accordingly.
|
||||
import patchlevel # noqa: E402
|
||||
|
||||
version, release = patchlevel.get_version_info()
|
||||
# See Doc/tools/extensions/patchlevel.py
|
||||
version, release = importlib.import_module('patchlevel').get_version_info()
|
||||
|
||||
rst_epilog = f"""
|
||||
.. |python_version_literal| replace:: ``Python {version}``
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue