gobject-introspection r207 - in trunk: . giscanner



Author: johan
Date: Tue Apr 22 01:31:59 2008
New Revision: 207
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=207&view=rev

Log:
2008-04-21  Johan Dahlin  <johan gnome org>

	* giscanner/cgobject.py: Use ctypes.util.find_library to locate
	gobject-2.0 and raise ImportError if not found.



Modified:
   trunk/ChangeLog
   trunk/giscanner/cgobject.py

Modified: trunk/giscanner/cgobject.py
==============================================================================
--- trunk/giscanner/cgobject.py	(original)
+++ trunk/giscanner/cgobject.py	Tue Apr 22 01:31:59 2008
@@ -10,6 +10,7 @@
 #
 
 import ctypes
+from ctypes.util import find_library
 
 # Constants
 
@@ -86,7 +87,10 @@
                 ('owner_type', GType)]
 
 
-_gobj = ctypes.cdll.LoadLibrary('libgobject-2.0.so')
+_library_path = find_library('gobject-2.0')
+if not _library_path:
+    raise ImportError("Could not find gobject-2.0 library")
+_gobj = ctypes.cdll.LoadLibrary(_library_path)
 _gobj.g_type_init()
 
 # Workaround this error:



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