diff --git a/bindings/__init__.py b/bindings/__init__.py index a5d2c47..b49dc36 100644 --- a/bindings/__init__.py +++ b/bindings/__init__.py @@ -1,11 +1,12 @@ import ctypes -sharedlib = './lib3ddevil1.so' -try: - libc = ctypes.cdll.LoadLibrary(sharedlib) -except OSError as e: - print("Error loading dynamically linked library.\nOSError: " + str(e)) - raise SystemExit("Couldn't load %s" % sharedlib) +def loadlibc(): + sharedlib = './lib3ddevil1.so' + libc = None + try: + libc = ctypes.cdll.LoadLibrary(sharedlib) + except OSError as e: + print("Error loading dynamically linked library.\nOSError: " + str(e)) + raise SystemExit("Couldn't load %s" % sharedlib) -# Don't need these anymore -del sharedlib +libc = loadlibc() \ No newline at end of file