Skip to content

Commit b8d2f65

Browse files
gh-161441: Fix test_pack_info for Tk 9.1.1 (GH-162512)
Since Tk 9.1.1 "pack info" returns an empty result for a window not managed by pack, instead of raising an error, consistently with "grid info" and "place info" (Tk ticket 3f5867c997).
1 parent 32b51e3 commit b8d2f65

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎Lib/test/test_tkinter/test_geometry_managers.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from test.support import requires
66

77
from test.test_tkinter.support import setUpModule # noqa: F401
8-
from test.test_tkinter.support import pixels_conv
8+
from test.test_tkinter.support import pixels_conv, get_tk_patchlevel
99
from test.test_tkinter.widget_tests import AbstractWidgetTest
1010

1111
requires('gui')
@@ -233,8 +233,8 @@ def test_pack_forget(self):
233233

234234
def test_pack_info(self):
235235
pack, a, b, c, d = self.create2()
236-
with self.assertRaisesRegex(TclError, 'window "%s" isn\'t packed' % a):
237-
a.pack_info()
236+
if get_tk_patchlevel(self.root) >= (9, 1, 1):
237+
self.assertEqual(a.pack_info(), {})
238238
a.pack_configure()
239239
b.pack_configure(side='right', in_=a, anchor='s', expand=True, fill='x',
240240
ipadx=5, padx=10, ipady=2, pady=(5, 15))

0 commit comments

Comments
 (0)