[pypy-svn] r50780 - in pypy/dist/pypy/module/clr: . test

antocuni at codespeak.net antocuni at codespeak.net
Sat Jan 19 16:28:57 CET 2008


Author: antocuni
Date: Sat Jan 19 16:28:56 2008
New Revision: 50780

Modified:
   pypy/dist/pypy/module/clr/interp_clr.py
   pypy/dist/pypy/module/clr/test/test_importer.py
Log:
don't fail if the indexer method is overloaded



Modified: pypy/dist/pypy/module/clr/interp_clr.py
==============================================================================
--- pypy/dist/pypy/module/clr/interp_clr.py	(original)
+++ pypy/dist/pypy/module/clr/interp_clr.py	Sat Jan 19 16:28:56 2008
@@ -159,7 +159,7 @@
 
 def get_properties(space, b_type):
     properties = []
-    indexers = []
+    indexers = {}
     b_propertyinfos = b_type.GetProperties()
     for i in range(len(b_propertyinfos)):
         b_prop = b_propertyinfos[i]
@@ -179,9 +179,9 @@
         if len(b_indexparams) == 0:
             properties.append((b_prop.get_Name(), get_name, set_name, is_static))
         else:
-            indexers.append((b_prop.get_Name(), get_name, set_name, is_static))
+            indexers[b_prop.get_Name(), get_name, set_name, is_static] = None
     w_properties = wrap_list_of_tuples(space, properties)
-    w_indexers = wrap_list_of_tuples(space, indexers)
+    w_indexers = wrap_list_of_tuples(space, indexers.keys())
     return w_properties, w_indexers
 
 class _CliClassCache:

Modified: pypy/dist/pypy/module/clr/test/test_importer.py
==============================================================================
--- pypy/dist/pypy/module/clr/test/test_importer.py	(original)
+++ pypy/dist/pypy/module/clr/test/test_importer.py	Sat Jan 19 16:28:56 2008
@@ -69,7 +69,7 @@
     def test_AddReferenceByPartialName(self):
         import clr
         def fn():
-            import System.Xml.XmlWriter
+            import System.Xml.XmlReader
         raises(ImportError, fn)
         clr.AddReferenceByPartialName('System.Xml')
         fn() # does not raise



More information about the Pypy-commit mailing list