From 29d89a27953858c24d61d2a31e4bb0f304bccd10 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Thu, 26 Aug 2021 08:55:53 -0500 Subject: [PATCH] Fix UnboundLocalError when default queue could not be created --- dpctl/_sycl_queue.pyx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dpctl/_sycl_queue.pyx b/dpctl/_sycl_queue.pyx index 2abfd3039f..d8ff0141ad 100644 --- a/dpctl/_sycl_queue.pyx +++ b/dpctl/_sycl_queue.pyx @@ -327,7 +327,11 @@ cdef class SyclQueue(_SyclQueue): .format(arg) ) elif status == -2 or status == -8: + default_dev_error = ( + "Default SYCL Device could not be created." + ) raise SyclQueueCreationError( + default_dev_error if (len_args == 0) else "SYCL Device '{}' could not be created.".format(arg) ) elif status == -3 or status == -7: