Skip to content

Commit c597e2e

Browse files
committed
Prevent pyluxcoretest crash even if there are no OpenCL device
1 parent faa42f6 commit c597e2e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

python/pyluxcoretest/pyluxcoretest.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,9 @@ def LuxRaysDeviceTests():
165165
deviceList = pyluxcore.GetOpenCLDeviceList()
166166
except RuntimeError as err:
167167
print(str(err))
168-
return
168+
return None
169169
print("OpenCL device list: %s\n" % str(deviceList), flush=True)
170+
return deviceList
170171

171172

172173
################################################################################
@@ -870,7 +871,9 @@ def main():
870871
# os.chdir(os.path.dirname(__file__))
871872

872873
PropertiesTests()
873-
LuxRaysDeviceTests()
874+
devices = LuxRaysDeviceTests()
875+
if devices is None:
876+
return
874877
SimpleRender()
875878
GetOutputTest()
876879
ExtractConfiguration()

0 commit comments

Comments
 (0)