Index: ltihooks.py
===================================================================
--- ltihooks.py	(revision 1065)
+++ ltihooks.py	(working copy)
@@ -1,60 +0,0 @@
-# -*- Mode: Python; py-indent-offset: 4 -*-
-# ltihooks.py: python import hooks that understand libtool libraries.
-# Copyright (C) 2000 James Henstridge.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
-import os, ihooks
-
-class LibtoolHooks(ihooks.Hooks):
-    def get_suffixes(self):
-        """Like normal get_suffixes, but adds .la suffixes to list"""
-        ret = ihooks.Hooks.get_suffixes(self)
-        ret.insert(0, ('module.la', 'rb', 3))
-        ret.insert(0, ('.la', 'rb', 3))
-        return ret
-
-    def load_dynamic(self, name, filename, file=None):
-        """Like normal load_dynamic, but treat .la files specially"""
-        if len(filename) > 3 and filename[-3:] == '.la':
-            fp = open(filename, 'r')
-            dlname = ''
-            installed = 1
-            line = fp.readline()
-            while line:
-                if len(line) > 7 and line[:7] == 'dlname=':
-                    dlname = line[8:-2]
-                elif len(line) > 10 and line[:10] == 'installed=':
-                    installed = line[10:-1] == 'yes'
-                line = fp.readline()
-            fp.close()
-            if dlname:
-                if installed:
-                    filename = os.path.join(os.path.dirname(filename),
-                                            dlname)
-                else:
-                    filename = os.path.join(os.path.dirname(filename),
-                                            '.libs', dlname)
-        return ihooks.Hooks.load_dynamic(self, name, filename, file)
-
-importer = ihooks.ModuleImporter()
-importer.set_hooks(LibtoolHooks())
-
-def install():
-    importer.install()
-def uninstall():
-    importer.uninstall()
-
-install()
Index: tests/common.py
===================================================================
--- tests/common.py	(revision 1065)
+++ tests/common.py	(working copy)
@@ -5,13 +5,11 @@
     # Be very careful when you change this code, it's
     # fragile and the order is really significant
 
-    # ltihooks
     sys.path.insert(0, srcDir)
     sys.path.insert(0, buildDir)
     sys.path.insert(0, os.path.join(buildDir, 'glib'))
     sys.path.insert(0, os.path.join(buildDir, 'gobject'))
     sys.path.insert(0, os.path.join(buildDir, 'gio'))
-    import ltihooks
 
     # testhelper
     sys.path.insert(0, os.path.join(buildDir, 'tests'))
@@ -22,9 +20,6 @@
     gobject = importModule('gobject', buildDir, 'gobject')
     gio = importModule('gio', buildDir, 'gio')
 
-    ltihooks.uninstall()
-    del ltihooks
-
     globals().update(locals())
 
     os.environ['PYGTK_USE_GIL_STATE_API'] = ''
Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am	(revision 1065)
+++ tests/Makefile.am	(working copy)
@@ -56,3 +56,10 @@
 	@rm -fr $(top_builddir)/glib/*.pyc
 	@rm -fr $(top_builddir)/gobject/*.pyc
 	@rm -fr $(top_builddir)/gio/*.pyc
+
+
+all: $(LTLIBRARIES:.la=.so)
+clean-local:
+	rm -f $(LTLIBRARIES:.la=.so)
+.la.so:
+	$(LN_S) .libs/$@ $@
Index: Makefile.am
===================================================================
--- Makefile.am	(revision 1065)
+++ Makefile.am	(working copy)
@@ -33,7 +33,6 @@
 # python
 pyexec_PYTHON = pygtk.py
 pyexec_LTLIBRARIES =
-noinst_PYTHON = ltihooks.py
 
 # linker flags
 common_ldflags = -module -avoid-version
Index: gobject/pygtype.c
===================================================================
--- gobject/pygtype.c	(revision 1065)
+++ gobject/pygtype.c	(working copy)
@@ -422,6 +422,16 @@
 		      g_type_name(enum_type),
 		      g_type_name(((PyGEnum *) obj)->gtype));
 	}
+    /* Dumb code duplication, but probably not worth it to have yet another macro. */
+    } else if (PyLong_Check(obj)) {
+	*val = PyLong_AsLong(obj);
+	res = 0;
+
+	if (PyObject_TypeCheck(obj, &PyGEnum_Type) && ((PyGEnum *) obj)->gtype != enum_type) {
+	    g_warning("expected enumeration type %s, but got %s instead",
+		      g_type_name(enum_type),
+		      g_type_name(((PyGEnum *) obj)->gtype));
+	}
     } else if (_PyUnicode_Check(obj)) {
 	GEnumValue *info;
 	char *str = _PyUnicode_AsString(obj);
Index: gobject/__init__.py
===================================================================
--- gobject/__init__.py	(revision 1065)
+++ gobject/__init__.py	(working copy)
@@ -21,13 +21,6 @@
 
 # this can go when things are a little further along
 
-try:
-    import ltihooks
-    ltihooks # pyflakes
-    del ltihooks
-except ImportError:
-    pass
-
 import sys
 
 from glib import spawn_async, idle_add, timeout_add, timeout_add_seconds, \
Index: gobject/Makefile.am
===================================================================
--- gobject/Makefile.am	(revision 1065)
+++ gobject/Makefile.am	(working copy)
@@ -71,3 +71,10 @@
 if PLATFORM_WIN32
 _gobject_la_CFLAGS += -DPLATFORM_WIN32
 endif
+
+
+all: $(pygobject_LTLIBRARIES:.la=.so)
+clean-local:
+	rm -f $(pygobject_LTLIBRARIES:.la=.so)
+.la.so:
+	$(LN_S) .libs/$@ $@
Index: glib/__init__.py
===================================================================
--- glib/__init__.py	(revision 1065)
+++ glib/__init__.py	(working copy)
@@ -19,14 +19,6 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
 # USA
 
-# this can go when things are a little further along
-try:
-    import ltihooks
-    ltihooks # pyflakes
-    del ltihooks
-except ImportError:
-    pass
-
 from glib._glib import *
 _PyGLib_API = _glib._PyGLib_API
 
Index: glib/Makefile.am
===================================================================
--- glib/Makefile.am	(revision 1065)
+++ glib/Makefile.am	(working copy)
@@ -50,3 +50,10 @@
 if PLATFORM_WIN32
 _glib_la_CFLAGS += -DPLATFORM_WIN32
 endif
+
+
+all: $(pyglib_LTLIBRARIES:.la=.so)
+clean-local:
+	rm -f $(pyglib_LTLIBRARIES:.la=.so)
+.la.so:
+	$(LN_S) .libs/$@ $@
Index: gio/__init__.py
===================================================================
--- gio/__init__.py	(revision 1065)
+++ gio/__init__.py	(working copy)
@@ -19,14 +19,6 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
 # USA
 
-# this can go when things are a little further along
-try:
-    import ltihooks
-    ltihooks # pyflakes
-    del ltihooks
-except ImportError:
-    pass
-
 from gobject import GObjectMeta
 from _gio import *
 from _gio import \
Index: gio/Makefile.am
===================================================================
--- gio/Makefile.am	(revision 1065)
+++ gio/Makefile.am	(working copy)
@@ -93,3 +93,12 @@
 	    --prefix py$(*F) $*.defs) > $(*D)/gen-$(*F).c \
 	&& cp $(*D)/gen-$(*F).c $(*D)/$(*F).c \
 	&& rm -f $(*D)/gen-$(*F).c
+
+
+if BUILD_GIO
+all: $(pkgpyexec_LTLIBRARIES:.la=.so)
+clean-local:
+	rm -f $(pkgpyexec_LTLIBRARIES:.la=.so)
+.la.so:
+	$(LN_S) .libs/$@ $@
+endif
