Author: Antonio Cuni <[email protected]>
Branch: faster-rstruct-2
Changeset: r91185:037cc12c66ea
Date: 2017-05-05 15:29 +0000
http://bitbucket.org/pypy/pypy/changeset/037cc12c66ea/
Log: if we don't ensure that StringBuffer.value is not None, the
annotator crashes as soon as you call str2chap(buf.as_str()). There
are lots of places which do the assert before calling
StringBuffer(), but I think it's simpler and better to just do it in
the __init__, as it has no chances to work if value is None
diff --git a/rpython/rlib/buffer.py b/rpython/rlib/buffer.py
--- a/rpython/rlib/buffer.py
+++ b/rpython/rlib/buffer.py
@@ -95,6 +95,7 @@
_immutable_ = True
def __init__(self, value):
+ assert value is not None
self.value = value
self.readonly = 1
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit