diff options
author | Johan Dahlin <johan@src.gnome.org> | 2006-08-05 15:54:29 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2006-08-05 15:54:29 +0000 |
commit | e461fe82fbb0b955c38bf75485a5b8afc7b7338b (patch) | |
tree | 27e87672c228e50624a0f6669805ede3635bc007 /gtk/__init__.py | |
parent | 73fb8e40389b59cbd62699ff4d35b97f5b5b2600 (diff) | |
download | pygtk-e461fe82fbb0b955c38bf75485a5b8afc7b7338b.tar.gz |
Make it possible to reload the gtk+ module, (#349026, Alexander Larsson)
* gtk/__init__.py (ver): Make it possible to reload the gtk+ module,
(#349026, Alexander Larsson)
* tests/test_api.py (APITest.testGlade): Add a test
Diffstat (limited to 'gtk/__init__.py')
-rw-r--r-- | gtk/__init__.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gtk/__init__.py b/gtk/__init__.py index 608646aa..61fe50df 100644 --- a/gtk/__init__.py +++ b/gtk/__init__.py @@ -42,7 +42,11 @@ if ver < (2, 11, 1): raise ImportError( "PyGTK requires PyGObject 2.11.1 or higher, but %s was found" % (ver,)) -from gtk import _gtk +if 'gtk._gtk' in sys.modules: + _gtk = sys.modules['gtk._gtk'] +else: + from gtk import _gtk + import gdk if ltihooks: @@ -117,7 +121,7 @@ FALSE = _DeprecatedConstant(False, 'gtk.FALSE', 'False') gdk.Warning = Warning # We don't want to export this -del _Deprecated, _DeprecatedConstant, _gobject, _init, _lazyutils +del _Deprecated, _DeprecatedConstant, _gobject, _init # Do this as late as possible, so programs like pyflakes can check # everything above |