File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -38,15 +38,14 @@ class python_bytes_sink : public iostreams::sink {
3838 std::streamsize write (const char * s, std::streamsize n) {
3939 if (len_ == 0 ) {
4040 *pstr_ = PyBytes_FromStringAndSize (s, n);
41- // no point trying to recover from allocation error
42- BOOST_ASSERT (*pstr_ != 0 );
41+ if (*pstr_ == 0 ) // no point trying to recover from allocation error
42+ std::abort ( );
4343 len_ = n;
4444 } else {
4545 if (pos_ + n > len_) {
4646 len_ = pos_ + n;
47- auto err_code = _PyBytes_Resize (pstr_, len_);
48- // no point trying to recover from allocation error
49- BOOST_ASSERT (err_code != -1 );
47+ if (_PyBytes_Resize (pstr_, len_) == -1 )
48+ std::abort (); // no point trying to recover from allocation error
5049 }
5150 char * b = PyBytes_AS_STRING (*pstr_);
5251 std::copy (s, s + n, b + pos_);
You can’t perform that action at this time.
0 commit comments