Commit 460732bf authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

The use of relative imports causes a cascade.

parent 31d75be4
......@@ -75,7 +75,12 @@ def OnStartup(modelingLanguage: str,
g_headerPython.append("import threading, time, sys, os, ctypes\n")
# g_headerPython.append("from PythonAccess import *")
g_headerPython.append("from . import DV")
g_headerPython.append('PythonAccess = ctypes.cdll.LoadLibrary("./PythonAccess.so")')
g_headerPython.append('try:')
g_headerPython.append(' PythonAccess = ctypes.cdll.LoadLibrary("./PythonAccess.so")')
g_headerPython.append('except OSError:')
g_headerPython.append(' folder = os.path.dirname(os.path.abspath(__file__))')
g_headerPython.append(' PythonAccess = ctypes.cdll.LoadLibrary(folder + "/PythonAccess.so")')
g_headerPython.append(' sys.path.append(folder)')
g_headerPython.append('OpenMsgQueueForReading = PythonAccess.OpenMsgQueueForReading')
g_headerPython.append('OpenMsgQueueForReading.restype = ctypes.c_int')
g_headerPython.append('CloseMsgQueue = PythonAccess.CloseMsgQueue')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment