From 14253206addd87dcb0e0e32f6f774d9b4363588c Mon Sep 17 00:00:00 2001 From: Yilei Yang Date: Thu, 28 Sep 2023 13:16:41 -0700 Subject: [PATCH 1/2] Fix #110050: Use a space instead of newline in the TypeError message of the random.seed call. --- Lib/random.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/random.py b/Lib/random.py index 1d789b107904fb..c6cc3a28629d2e 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -164,7 +164,7 @@ def seed(self, a=None, version=2): a = int.from_bytes(a + _sha512(a).digest()) elif not isinstance(a, (type(None), int, float, str, bytes, bytearray)): - raise TypeError('The only supported seed types are: None,\n' + raise TypeError('The only supported seed types are: None, ' 'int, float, str, bytes, and bytearray.') super().seed(a) From f88c21b479f7e87e4746b42b8bb5ce9ba7a799d8 Mon Sep 17 00:00:00 2001 From: Yilei Yang Date: Thu, 28 Sep 2023 20:05:43 -0700 Subject: [PATCH 2/2] Keep the newline. --- Lib/random.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/random.py b/Lib/random.py index c6cc3a28629d2e..ab7b6148185e8a 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -164,8 +164,8 @@ def seed(self, a=None, version=2): a = int.from_bytes(a + _sha512(a).digest()) elif not isinstance(a, (type(None), int, float, str, bytes, bytearray)): - raise TypeError('The only supported seed types are: None, ' - 'int, float, str, bytes, and bytearray.') + raise TypeError('The only supported seed types are:\n' + 'None, int, float, str, bytes, and bytearray.') super().seed(a) self.gauss_next = None