declared function where del sharedlib is not needed anymore

This commit is contained in:
_ 2018-05-17 14:00:52 -07:00
parent a2d91cd56b
commit 360de0dea5

View File

@ -1,11 +1,12 @@
import ctypes import ctypes
sharedlib = './lib3ddevil1.so' def loadlibc():
try: sharedlib = './lib3ddevil1.so'
libc = ctypes.cdll.LoadLibrary(sharedlib) libc = None
except OSError as e: try:
print("Error loading dynamically linked library.\nOSError: " + str(e)) libc = ctypes.cdll.LoadLibrary(sharedlib)
raise SystemExit("Couldn't load %s" % 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 libc = loadlibc()
del sharedlib