From: Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> Date: Thu, 6 Aug 2026 14:49:24 +0000 (+0200) Subject: gh-109861: Fix a doctest in Lib/_pydecimal.py which was failing when running its... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5965f08d702aadfc5ae51134c22261cefbc82da5;p=thirdparty%2FPython%2Fcpython.git gh-109861: Fix a doctest in Lib/_pydecimal.py which was failing when running its doctests directly (GH-125479) 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 Co-authored-by: Sergey B Kirpichev --- diff --git a/Lib/_pydecimal.py b/Lib/_pydecimal.py index e0b32b7a5e21..57d6143daea4 100644 --- a/Lib/_pydecimal.py +++ b/Lib/_pydecimal.py @@ -1824,9 +1824,10 @@ class Decimal(object): 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') """