Skip to content

Commit daf22ca

Browse files
[3.11] gh-104411: Update test_getint for Tcl 9.0 (GH-104412) (#105357)
gh-104411: Update test_getint for Tcl 9.0 (GH-104412) (cherry picked from commit 2c49c75) Co-authored-by: Christopher Chavez <[email protected]>
1 parent c644fe4 commit daf22ca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/test/test_tcl.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ def test_getint(self):
145145
for i in self.get_integers():
146146
self.assertEqual(tcl.getint(' %d ' % i), i)
147147
self.assertEqual(tcl.getint(' %#o ' % i), i)
148-
self.assertEqual(tcl.getint((' %#o ' % i).replace('o', '')), i)
148+
# Numbers starting with 0 are parsed as decimal in Tcl 9.0
149+
# and as octal in older versions.
150+
self.assertEqual(tcl.getint((' %#o ' % i).replace('o', '')),
151+
i if tcl_version < (9, 0) else int('%o' % i))
149152
self.assertEqual(tcl.getint(' %#x ' % i), i)
150153
self.assertEqual(tcl.getint(42), 42)
151154
self.assertRaises(TypeError, tcl.getint)

0 commit comments

Comments
 (0)