mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
gh-91827: Add method info_pathlevel() in tkinter (GH-91829)
This commit is contained in:
parent
d707d073be
commit
15dbe8570f
8 changed files with 75 additions and 23 deletions
|
@ -28,15 +28,7 @@ def get_tk_patchlevel():
|
|||
global _tk_patchlevel
|
||||
if _tk_patchlevel is None:
|
||||
tcl = Tcl()
|
||||
patchlevel = tcl.call('info', 'patchlevel')
|
||||
m = re.fullmatch(r'(\d+)\.(\d+)([ab.])(\d+)', patchlevel)
|
||||
major, minor, releaselevel, serial = m.groups()
|
||||
major, minor, serial = int(major), int(minor), int(serial)
|
||||
releaselevel = {'a': 'alpha', 'b': 'beta', '.': 'final'}[releaselevel]
|
||||
if releaselevel == 'final':
|
||||
_tk_patchlevel = major, minor, serial, releaselevel, 0
|
||||
else:
|
||||
_tk_patchlevel = major, minor, 0, releaselevel, serial
|
||||
_tk_patchlevel = tcl.info_patchlevel()
|
||||
return _tk_patchlevel
|
||||
|
||||
|
||||
|
@ -723,7 +715,7 @@ class BigmemTclTest(unittest.TestCase):
|
|||
def setUpModule():
|
||||
if support.verbose:
|
||||
tcl = Tcl()
|
||||
print('patchlevel =', tcl.call('info', 'patchlevel'))
|
||||
print('patchlevel =', tcl.call('info', 'patchlevel'), flush=True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue