Changeset 1088


Ignore:
Timestamp:
02/20/21 13:26:18 (8 days ago)
Author:
Maciej Komosinski
Message:

More friendly message when the dll/so cannot be found

File:
1 edited

Legend:

Unmodified
Added
Removed
  • framspy/frams.py

    r1087 r1088  
    1212All non-Framsticks Python attributes start with '_' to avoid conflicts with Framsticks attributes.
    1313Framsticks names that are Python reserved words are prefixed with 'x' (currently just Simulator.ximport).
     14
     15For sample usage, see frams-test.py and FramsticksLib.py.
    1416"""
    1517
     
    295297        if lib_path is not None and os.name == 'posix':
    296298                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 './'
    297         c_api = ctypes.CDLL(lib_name)
     299        try:
     300                c_api = ctypes.CDLL(lib_name)
     301        except OSError as e:
     302                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()))
     303                raise
    298304        os.chdir(original_dir)
    299305
Note: See TracChangeset for help on using the changeset viewer.