Skip to content

Commit e897743

Browse files
committed
compiler error fix
1 parent 06d5a06 commit e897743

File tree

1 file changed

+2
-1
lines changed
  • cuda_bindings/cuda/bindings/_internal

1 file changed

+2
-1
lines changed

cuda_bindings/cuda/bindings/_internal/utils.pyx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
44

55
cimport cpython
6+
from cpython.bytes cimport PyBytes_AsString
67
from libc.stdint cimport intptr_t
78
from libcpp.utility cimport move
89
from cython.operator cimport dereference as deref
@@ -130,7 +131,7 @@ cdef int get_nested_resource_ptr(nested_resource[ResT] &in_out_ptr, object obj,
130131
f"Expected str or bytes, got {obj_i_type.__name__}")
131132
str_len = <size_t>(len(obj_i_bytes)) + 1 # including null termination
132133
deref(nested_res_vec)[i].resize(str_len)
133-
obj_i_ptr = <char*>(obj_i_bytes)
134+
obj_i_ptr = PyBytes_AsString(obj_i_bytes)
134135
# cast to size_t explicitly to work around a potentially Cython bug
135136
deref(nested_res_vec)[i].assign(obj_i_ptr, obj_i_ptr + <size_t>str_len)
136137
else:

0 commit comments

Comments
 (0)