[pypy-commit] pypy string-NUL: Fix.

arigo noreply at buildbot.pypy.org
Sat Feb 4 13:23:56 CET 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: string-NUL
Changeset: r52083:a768ccc1c97a
Date: 2012-02-04 12:13 +0100
http://bitbucket.org/pypy/pypy/changeset/a768ccc1c97a/

Log:	Fix.

diff --git a/pypy/rlib/rstring.py b/pypy/rlib/rstring.py
--- a/pypy/rlib/rstring.py
+++ b/pypy/rlib/rstring.py
@@ -216,6 +216,8 @@
     _about_ = assert_str0
 
     def compute_result_annotation(self, s_obj):
+        if s_None.contains(s_obj):
+            return s_obj
         assert isinstance(s_obj, (SomeString, SomeUnicodeString))
         if s_obj.no_nul:
             return s_obj
@@ -237,7 +239,7 @@
     _about_ = check_str0
 
     def compute_result_annotation(self, s_obj):
-        if not isinstance(s_obj, SomeString):
+        if not isinstance(s_obj, (SomeString, SomeUnicodeString)):
             return s_obj
         if not s_obj.no_nul:
             raise ValueError("Value is not no_nul")


More information about the pypy-commit mailing list