-
Notifications
You must be signed in to change notification settings - Fork 30
Support for function update_deadline in Python target
#558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
b36044b
7955c34
96c53bf
6efb7a8
3e9e32a
841dbcd
3f9182b
ac62321
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1 +1 @@ | ||||||
| master | ||||||
| python-update-deadline | ||||||
|
||||||
| python-update-deadline | |
| master |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -242,6 +242,25 @@ PyObject* py_check_deadline(PyObject* self, PyObject* args) { | |||||
| return PyBool_FromLong(result); | ||||||
| } | ||||||
|
|
||||||
| PyObject* py_update_deadline(PyObject* self, PyObject* args) { | ||||||
| PyObject* py_self; | ||||||
| int64_t updated_deadline = 0; // Default to 0 | ||||||
| double updated_deadline_in_double = | ||||||
| 0.0; // Deadline may be passed as a floating-point value in nanoseconds, e.g., SEC(0.5) → 0.5 * 1e9. | ||||||
|
|
||||||
| if (!PyArg_ParseTuple(args, "O|d", &py_self, &updated_deadline_in_double)) { | ||||||
|
||||||
| if (!PyArg_ParseTuple(args, "O|d", &py_self, &updated_deadline_in_double)) { | |
| if (!PyArg_ParseTuple(args, "Od", &py_self, &updated_deadline_in_double)) { |
Copilot
AI
Mar 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR description says the deadline is converted to uint64_t, but the implementation uses int64_t/interval_t (and checks against INT64_{MIN,MAX}). Either update the description or align the implementation/type expectations so the API contract is unambiguous (especially for negative values like NEVER).
Copilot
AI
Mar 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
py_update_deadline is incomplete: it never calls get_lf_self_pointer()/lf_update_deadline(), does not Py_INCREF(Py_None)/return Py_None, and the function body is missing its closing } (it currently falls through into the next comment/function). This will break compilation and the API won’t work as intended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be changed to master after the companion merge occurs.