Changeset 1141 for framspy


Ignore:
Timestamp:
05/17/21 15:39:43 (4 years ago)
Author:
Maciej Komosinski
Message:

More useful exception message - shows argument type

File:
1 edited

Legend:

Unmodified
Added
Removed
  • framspy/frams.py

    r1123 r1141  
    4444                        self._initFromNull()
    4545                else:
    46                         raise ArgumentError("Can't make ExtValue from '" + str(arg) + "'")
     46                        raise ctypes.ArgumentError("Can't make ExtValue from '%s' (%s)" % (str(arg), type(arg)))
    4747
    4848
     
    300300                lib_name = './' + lib_name  # currently we always have lib_path (even if it is incorrect) but hypothetically it could work with lib_path==None and load .so from some default system path without './'
    301301        try:
    302                 c_api = ctypes.CDLL(lib_name)
     302                c_api = ctypes.CDLL(lib_name)  # should be a separate instance and no globals if we want multiple threads to use this module (todo?)
    303303        except OSError as e:
    304304                print("*** Could not find or open '%s' from '%s'.\n*** Did you provide proper arguments and is this file readable?\n" % (lib_name, os.getcwd()))
     
    355355                                attr = attr._value()
    356356                        setattr(sys.modules[__name__], n, attr)
    357                        
     357
    358358        print('Using Framsticks version: ' + str(Simulator.version_string))
    359359        print('Home (writable) dir     : ' + home_dir)
Note: See TracChangeset for help on using the changeset viewer.