Skip to content

Commit

Permalink
pythongh-104411: Update test_getint for Tcl 9.0 (pythonGH-104412)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrstphrchvz authored Jun 6, 2023
1 parent 8ddf0dd commit 2c49c75
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Lib/test/test_tcl.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ def test_getint(self):
for i in self.get_integers():
self.assertEqual(tcl.getint(' %d ' % i), i)
self.assertEqual(tcl.getint(' %#o ' % i), i)
self.assertEqual(tcl.getint((' %#o ' % i).replace('o', '')), i)
# Numbers starting with 0 are parsed as decimal in Tcl 9.0
# and as octal in older versions.
self.assertEqual(tcl.getint((' %#o ' % i).replace('o', '')),
i if tcl_version < (9, 0) else int('%o' % i))
self.assertEqual(tcl.getint(' %#x ' % i), i)
self.assertEqual(tcl.getint(42), 42)
self.assertRaises(TypeError, tcl.getint)
Expand Down

0 comments on commit 2c49c75

Please sign in to comment.