https://github.com/python/cpython/commit/085fd75cb2b0b2b16d640020835545b9988e63fb
commit: 085fd75cb2b0b2b16d640020835545b9988e63fb
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-08-06T15:18:32Z
summary:

[3.14] gh-109861: Fix a doctest in Lib/_pydecimal.py which was failing when 
running its doctests directly (GH-125479) (GH-155288)

Fix a doctest in ``Lib/_pydecimal.py`` which was failing when run
directly on the module via the command:

  ./python.exe -m doctest Lib/_pydecimal.py
(cherry picked from commit 5965f08d702aadfc5ae51134c22261cefbc82da5)

Co-authored-by: Mark Byrne <[email protected]>
Co-authored-by: Sergey B Kirpichev <[email protected]>

files:
M Lib/_pydecimal.py

diff --git a/Lib/_pydecimal.py b/Lib/_pydecimal.py
index 2277578df5412b..e944c9fb21ca7f 100644
--- a/Lib/_pydecimal.py
+++ b/Lib/_pydecimal.py
@@ -1821,9 +1821,10 @@ def __round__(self, n=None):
         Decimal('123.46')
         >>> round(Decimal('123.456'), -2)
         Decimal('1E+2')
-        >>> round(Decimal('-Infinity'), 37)
+        >>> with localcontext(ExtendedContext):
+        ...     round(Decimal('-Infinity'), 37)
+        ...     round(Decimal('sNaN123'), 0)
         Decimal('NaN')
-        >>> round(Decimal('sNaN123'), 0)
         Decimal('NaN123')
 
         """

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to