[pypy-svn] r63897 - pypy/branch/pyjitpl5-simplify/pypy/rpython/ootypesystem

antocuni at codespeak.net antocuni at codespeak.net
Thu Apr 9 16:23:20 CEST 2009


Author: antocuni
Date: Thu Apr  9 16:23:19 2009
New Revision: 63897

Modified:
   pypy/branch/pyjitpl5-simplify/pypy/rpython/ootypesystem/ootype.py
Log:
manually merge some of the changes done on trunk between r52360 and r63895


Modified: pypy/branch/pyjitpl5-simplify/pypy/rpython/ootypesystem/ootype.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/rpython/ootypesystem/ootype.py	(original)
+++ pypy/branch/pyjitpl5-simplify/pypy/rpython/ootypesystem/ootype.py	Thu Apr  9 16:23:19 2009
@@ -1024,8 +1024,8 @@
 
     def __init__(self, INSTANCE, inst):
         self.__dict__['_TYPE'] = INSTANCE
-        assert isinstance(inst, _instance)
-        assert isSubclass(inst._TYPE, INSTANCE)
+        assert isinstance(inst, (_instance, _record))
+        assert isinstance(inst._TYPE, Record) or isSubclass(inst._TYPE, INSTANCE)
         self.__dict__['_inst'] = inst
 
     def __repr__(self):
@@ -1389,10 +1389,14 @@
 
     def ll_find(self, s, start, end):
         # NOT_RPYTHON
+        if start > len(self._str):  # workaround to cope with corner case
+            return -1               # bugs in CPython 2.4 unicode.find('')
         return self._str.find(s._str, start, end)
 
     def ll_rfind(self, s, start, end):
         # NOT_RPYTHON
+        if start > len(self._str):  # workaround to cope with corner case
+            return -1               # bugs in CPython 2.4 unicode.rfind('')
         return self._str.rfind(s._str, start, end)
 
     def ll_count(self, s, start, end):



More information about the Pypy-commit mailing list