Author: Armin Rigo <ar...@tunes.org>
Branch: unicode-utf8-re
Changeset: r93345:78d73593a136
Date: 2017-12-10 07:36 +0100
http://bitbucket.org/pypy/pypy/changeset/78d73593a136/

Log:    Add sanity-checks

diff --git a/pypy/module/_sre/interp_sre.py b/pypy/module/_sre/interp_sre.py
--- a/pypy/module/_sre/interp_sre.py
+++ b/pypy/module/_sre/interp_sre.py
@@ -349,8 +349,10 @@
         if use_builder != '\x00':
             result_bytes = strbuilder.build()
             if use_builder == 'S':
+                assert not isinstance(ctx, rsre_utf8.Utf8MatchContext)
                 return space.newbytes(result_bytes), n
             elif use_builder == 'U':
+                assert isinstance(ctx, rsre_utf8.Utf8MatchContext)
                 return space.newutf8(result_bytes,
                                      rutf8.get_utf8_length(result_bytes)), n
             else:
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to