gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libextractor-python] branch master updated: +


From: gnunet
Subject: [GNUnet-SVN] [libextractor-python] branch master updated: +
Date: Sat, 16 Jun 2018 16:46:17 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository libextractor-python.

The following commit(s) were added to refs/heads/master by this push:
     new fea270d  +
fea270d is described below

commit fea270d932e34b392a51cd2a003833e14007029c
Author: Nils Gillmann <address@hidden>
AuthorDate: Sat Jun 16 14:46:49 2018 +0000

    +
    
    Signed-off-by: Nils Gillmann <address@hidden>
---
 libextractor/extractor.py | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/libextractor/extractor.py b/libextractor/extractor.py
index b4ba3d9..3d5c1dc 100644
--- a/libextractor/extractor.py
+++ b/libextractor/extractor.py
@@ -33,14 +33,25 @@ file-types.
 libextractor is a part of the GNU project (http://www.gnu.org/).
 """
 from ctypes import *
+from ctypes import CDLL
 from ctypes.util import find_library
+import os
+
+# Can be useful:
+# "DYLD_LIBRARY_PATH" in os.environ
 
 # fake cdll import
+# loading shared object file
 try:
-    # loading shared object file
-    libextractor = cdll.LoadLibrary(find_library('libextractor.so.3'))
-except OSError:
-    libextractor = cdll.extractor
+    if os.uname()[0] == 'Linux':
+        libextractor = CDLL('libextractor.so.3')
+    elif os.uname()[0] == 'Linux':
+        libextractor = cdll.LoadLibrary(find_library('libextractor.so.3'))
+    else:
+        libextractor = cdll.extractor
+except:
+    raise ImportError("Could not find shared 'libextractor' library.")
+
 
 __all__ = ['Extractor']
 __version__ = "1.7"

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]