Skip to content

Commit

Permalink
[3.11] pythongh-104411: Update test_getint for Tcl 9.0 (pythonGH-104412
Browse files Browse the repository at this point in the history
…) (python#105357)

pythongh-104411: Update test_getint for Tcl 9.0 (pythonGH-104412)
(cherry picked from commit 2c49c75)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
  • Loading branch information
miss-islington and chrstphrchvz authored Jun 6, 2023
1 parent c644fe4 commit daf22ca
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 @@ -145,7 +145,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 daf22ca

Please sign in to comment.