GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.11] gh-105375: Improve _decimal error handling (GH-105605) (#105648) · python/cpython@cb26faf

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Misc/NEWS.d/next/Library
    • 2023-06-09-22-52-45.gh-issue-105375.6igkhn.rst
  • Modules/_decimal
    • _decimal.c
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Misc/NEWS.d/next/Library/2023-06-09-22-52-45.gh-issue-105375.6igkhn.rst‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bug in :mod:`decimal` where an exception could end up being overwritten.
Collapse file

‎Modules/_decimal/_decimal.c‎

Copy file name to clipboardExpand all lines: Modules/_decimal/_decimal.c
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3658,9 +3658,13 @@ dec_as_integer_ratio(PyObject *self, PyObject *args UNUSED)
36583658
goto error;
36593659
}
36603660
Py_SETREF(numerator, _py_long_floor_divide(numerator, tmp));
3661+
if (numerator == NULL) {
3662+
Py_DECREF(tmp);
3663+
goto error;
3664+
}
36613665
Py_SETREF(denominator, _py_long_floor_divide(denominator, tmp));
36623666
Py_DECREF(tmp);
3663-
if (numerator == NULL || denominator == NULL) {
3667+
if (denominator == NULL) {
36643668
goto error;
36653669
}
36663670
}

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.