Merge pull request #90 from gleeda/master

small fix to allow distorm3 to work with pyinstaller
diff --git a/python/distorm3/__init__.py b/python/distorm3/__init__.py
index 734c7c8..2345c1e 100644
--- a/python/distorm3/__init__.py
+++ b/python/distorm3/__init__.py
@@ -27,12 +27,15 @@
 

 from ctypes import *

 from os.path import split, join

+import sys

 

 #==============================================================================

 # Load the diStorm DLL

 

 # Guess the DLL filename and load the library.

 _distorm_path = split(__file__)[0]

+if hasattr(sys, '_MEIPASS'):

+    _distorm_path = sys._MEIPASS

 potential_libs = ['distorm3.dll', 'libdistorm3.dll', 'libdistorm3.so', 'libdistorm3.dylib']

 lib_was_found = False

 for i in potential_libs: