Skip to content

Fix swapped warnings.warn arguments in C Bezier3P and Bezier4P - #1486

Merged
mozman merged 1 commit into
mozman:masterfrom
zzoraemon043:fix/c-bezier-deprecation-warning
Nov 23, 2026
Merged

mozman merged 1 commit into
mozman:masterfrom
zzoraemon043:fix/c-bezier-deprecation-warning

Conversation

@zzoraemon043

Copy link
Copy Markdown
Contributor

The C versions of Bezier3P and Bezier4P pass the arguments of warnings.warn() in the wrong order. With the C extension, tuple control points raise a TypeError instead of the intended DeprecationWarning:

from ezdxf.math import Bezier4P
Bezier4P([(0, 0), (1, 0), (1, 1), (0, 1)])
# TypeError: category must be a Warning subclass, not 'str'

The fix swaps the two arguments, so the message comes first and the category second. Added a test for each class: both fail before the fix and pass after.

pytest tests (C extension built): 8196 passed, 28 skipped.

@mozman
mozman merged commit 8893485 into mozman:master Nov 23, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants