17
0
Files
python-uncertainties/support-python314.patch
Steve Kowalik 33bd4c4b76 - Update to 3.2.3:
* Changes:
    + Changes how numpy is handled as an optional dependency. Now a
      NotImplementedError is raised indicating that the function can't be
      used because numpy couldn't be imported.
    + Refactors the implementation for the calculation of the derivatives
      of the power function and improves the corresponding testing.
  * Fixes:
    + Adds documentation for ufloat_fromstr behavior for strings which do
      not contain uncertainty.
    + Fixes typos in ufloat_fromstr docstring examples (#285)
    + Fixes a bug that resulted in a ZeroDivisionError while formatting
      very small numbers with uncertainty (#135)
- Add patch support-python314.patch:
  * Support Python 3.14 changes.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-uncertainties?expand=0&rev=34
2025-11-10 02:58:16 +00:00

32 lines
1.2 KiB
Diff

From 2f184a480a073473cc8f5ab10cb016eaba3ba867 Mon Sep 17 00:00:00 2001
From: Will Shanks <wshaos@posteo.net>
Date: Sun, 7 Sep 2025 09:34:56 -0400
Subject: [PATCH 1/9] Update `log` exception test to work Python 3.14
---
tests/test_umath.py | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
Index: uncertainties-3.2.3/tests/test_umath.py
===================================================================
--- uncertainties-3.2.3.orig/tests/test_umath.py
+++ uncertainties-3.2.3/tests/test_umath.py
@@ -241,6 +241,17 @@ def test_math_module():
assert err_math_args == err_ufloat.args
else:
raise Exception("%s exception expected" % exception_class.__name__)
+
+ # Exception message is different for int and float so create the math
+ # exception for float rather than reusing the int one above
+ try:
+ math.log(0.0)
+ except Exception as err_math:
+ # Python 3 does not make exceptions local variables: they are
+ # restricted to their except block:
+ err_math_args = err_math.args
+ exception_class = err_math.__class__
+
try:
umath_core.log(ufloat(0, 0))
except exception_class as err_ufloat: