Changeset 95f0cbb in sasview for src


Ignore:
Timestamp:
Nov 30, 2016 8:28:51 AM (8 years ago)
Author:
wojciech
Children:
c027106e
Parents:
6a569b3
Message:

Added better exception handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/gpu_options.py

    r6a569b3 r95f0cbb  
    7777 
    7878    def _get_clinfo(self): 
     79        clinfo = [] 
     80 
    7981        try: 
    8082            import pyopencl as cl 
    81             clinfo = [] 
    8283            for platform in cl.get_platforms(): 
    8384                for device in platform.get_devices(): 
    8485                    clinfo.append(device.name) 
    85             clinfo.append("No OpenCL") 
    8686        except ImportError: 
    87             warnings.warn("pyopencl import failed") 
    88             clinfo = None 
     87            warnings.warn("pyopencl import failed. Please check installation") 
     88 
     89        clinfo.append("No OpenCL") 
    8990        return clinfo 
    9091 
Note: See TracChangeset for help on using the changeset viewer.