diff options
author | Johan Dahlin <johan@src.gnome.org> | 2006-08-05 15:27:48 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2006-08-05 15:27:48 +0000 |
commit | 52dec17a0696c382502214bf7c58f6ace8834294 (patch) | |
tree | 00baccadfbee16b41eca6e90614fd21e8135d501 | |
parent | 6be712c2f6ac9efb4e354276050f9f82b180a4d3 (diff) | |
download | pygtk-52dec17a0696c382502214bf7c58f6ace8834294.tar.gz |
Special case __members__ to dir on the real module, fixes (#349892, John
* gtk/_lazyutils.py (LazyModule.__getattr__): Special case __members__
to dir on the real module, fixes (#349892, John Finlay)
* tests/test_api.py (APITest.testKeysyms):
Add a test
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | gtk/_lazyutils.py | 2 | ||||
-rw-r--r-- | tests/test_api.py | 1 |
3 files changed, 11 insertions, 0 deletions
@@ -1,3 +1,11 @@ +2006-08-05 Johan Dahlin <jdahlin@async.com.br> + + * gtk/_lazyutils.py (LazyModule.__getattr__): Special case __members__ + to dir on the real module, fixes (#349892, John Finlay) + + * tests/test_api.py (APITest.testKeysyms): + Add a test + 2006-08-05 John Finlay <finlay@moeraki.com> * gtk/gtkunixprint.override (pygtk_custom_destroy_notify): Add this diff --git a/gtk/_lazyutils.py b/gtk/_lazyutils.py index 2bc3aa60..2a053134 100644 --- a/gtk/_lazyutils.py +++ b/gtk/_lazyutils.py @@ -31,6 +31,8 @@ class LazyModule(object): def __getattr__(self, attr): module = __import__(self._name, self._locals, {}, ' ') sys.modules[self._modname] = module + if attr == '__members__': + return dir(module) return getattr(module, attr) class _NotLoadedMarker: diff --git a/tests/test_api.py b/tests/test_api.py index cc79c840..beb22a46 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -4,6 +4,7 @@ from common import gobject, gtk, glade class APITest(unittest.TestCase): def testKeysyms(self): + self.failUnless('Escape' in dir(gtk.keysyms)) self.failUnless(hasattr(gtk.keysyms, 'Escape')) self.assertEqual(gtk.keysyms.Escape, 0xFF1B) |