From 9f8b855ddd2ca77ff950d8727a1513c6017fd6cd Mon Sep 17 00:00:00 2001 From: Christopher Chavez Date: Thu, 11 May 2023 19:56:57 -0500 Subject: [PATCH] gh-104411: Update test_getint for Tcl 9.0 --- Lib/test/test_tcl.py | 4 +++- .../next/Tests/2023-05-12-00-57-00.gh-issue-104411.H4m2sS.rst | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Tests/2023-05-12-00-57-00.gh-issue-104411.H4m2sS.rst diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py index cd79024ab2c8e3..ae623ab9689e68 100644 --- a/Lib/test/test_tcl.py +++ b/Lib/test/test_tcl.py @@ -142,7 +142,9 @@ 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) + self.assertEqual(tcl.getint((' %#o ' % i).replace('o', '')), + i if tcl_version < (9, 0) else + int(('%#o' % i).replace('o', ''))) self.assertEqual(tcl.getint(' %#x ' % i), i) self.assertEqual(tcl.getint(42), 42) self.assertRaises(TypeError, tcl.getint) diff --git a/Misc/NEWS.d/next/Tests/2023-05-12-00-57-00.gh-issue-104411.H4m2sS.rst b/Misc/NEWS.d/next/Tests/2023-05-12-00-57-00.gh-issue-104411.H4m2sS.rst new file mode 100644 index 00000000000000..be94a022cd6846 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2023-05-12-00-57-00.gh-issue-104411.H4m2sS.rst @@ -0,0 +1 @@ +Update test_getint for changes to octal integer parsing in Tcl 9.0. \ No newline at end of file