Skip to content

Commit bde3ff2

Browse files
author
Diptorup Deb
committed
Convert prints to warnings
1 parent cea8fa9 commit bde3ff2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

dpctl/_sycl_platform.pyx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ from ._backend cimport ( # noqa: E211
4646
_backend_type,
4747
)
4848

49+
import warnings
50+
4951
from .enum_types import backend_type
5052

5153
__all__ = [
@@ -199,14 +201,14 @@ cdef class SyclPlatform(_SyclPlatform):
199201
cdef size_t v = 0
200202

201203
if not isinstance(verbosity, int):
202-
print(
204+
warnings.warn(
203205
"Illegal verbosity level. Accepted values are 0, 1, or 2. "
204206
"Using the default verbosity level of 0."
205207
)
206208
else:
207209
v = <size_t>(verbosity)
208210
if v > 2:
209-
print(
211+
warnings.warn(
210212
"Illegal verbosity level. Accepted values are 0, 1, or 2. "
211213
"Using the default verbosity level of 0."
212214
)
@@ -331,7 +333,7 @@ def lsplatform(verbosity=0):
331333
else:
332334
v = <size_t>(verbosity)
333335
if v > 2:
334-
print(
336+
warnings.warn(
335337
"Illegal verbosity level. Accepted values are 0, 1, or 2. "
336338
"Using the default verbosity level of 0."
337339
)

0 commit comments

Comments
 (0)