https://github.com/python/cpython/commit/50cd00bf195e832dcbce1782776c46f918b59fc8
commit: 50cd00bf195e832dcbce1782776c46f918b59fc8
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-08-06T15:14:20Z
summary:

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

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 f83524a25604da..4c15889ce5a1c4 100644
--- a/Lib/_pydecimal.py
+++ b/Lib/_pydecimal.py
@@ -1783,9 +1783,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