Skip to content

Commit f74821f

Browse files
mbyrnepr2skirpichev
authored andcommitted
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 (cherry picked from commit 5965f08) Co-authored-by: Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
1 parent 4e87f4e commit f74821f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/_pydecimal.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,9 +1821,10 @@ def __round__(self, n=None):
18211821
Decimal('123.46')
18221822
>>> round(Decimal('123.456'), -2)
18231823
Decimal('1E+2')
1824-
>>> round(Decimal('-Infinity'), 37)
1824+
>>> with localcontext(ExtendedContext):
1825+
... round(Decimal('-Infinity'), 37)
1826+
... round(Decimal('sNaN123'), 0)
18251827
Decimal('NaN')
1826-
>>> round(Decimal('sNaN123'), 0)
18271828
Decimal('NaN123')
18281829
18291830
"""

0 commit comments

Comments
 (0)