Upload hf_env/lib/python3.14/site-packages/numpy/f2py/tests/src/callback/gh26681.f90 with huggingface_hub
Browse files
hf_env/lib/python3.14/site-packages/numpy/f2py/tests/src/callback/gh26681.f90
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
module utils
|
| 2 |
+
implicit none
|
| 3 |
+
contains
|
| 4 |
+
subroutine my_abort(message)
|
| 5 |
+
implicit none
|
| 6 |
+
character(len=*), intent(in) :: message
|
| 7 |
+
!f2py callstatement PyErr_SetString(PyExc_ValueError, message);f2py_success = 0;
|
| 8 |
+
!f2py callprotoargument char*
|
| 9 |
+
write(0,*) "THIS SHOULD NOT APPEAR"
|
| 10 |
+
stop 1
|
| 11 |
+
end subroutine my_abort
|
| 12 |
+
|
| 13 |
+
subroutine do_something(message)
|
| 14 |
+
!f2py intent(callback, hide) mypy_abort
|
| 15 |
+
character(len=*), intent(in) :: message
|
| 16 |
+
call mypy_abort(message)
|
| 17 |
+
end subroutine do_something
|
| 18 |
+
end module utils
|