Changeset 1096 for framspy/frams.py


Ignore:
Timestamp:
03/04/21 21:08:25 (4 years ago)
Author:
sz
Message:

restore the original working directory after frams.init()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • framspy/frams.py

    r1088 r1096  
    302302                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()))
    303303                raise
    304         os.chdir(original_dir)
     304        os.chdir(original_dir) # restore cwd after loading so framsticks see the expected directory
    305305
    306306        c_api.init.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_char_p)]
     
    345345        c_args = (ctypes.c_char_p * len(initargs))(*list(a.encode(ExtValue._encoding) for a in initargs))
    346346        c_api.init(len(initargs), c_args)
     347        os.chdir(original_dir) # restore again, because framsticks change dir to 'data'
    347348        Root = ExtValue._rootObject()
    348349        for n in dir(Root):
Note: See TracChangeset for help on using the changeset viewer.