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 {
38
38
std::streamsize write (const char * s, std::streamsize n) {
39
39
if (len_ == 0 ) {
40
40
*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 ( );
43
43
len_ = n;
44
44
} else {
45
45
if (pos_ + n > len_) {
46
46
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
50
49
}
51
50
char * b = PyBytes_AS_STRING (*pstr_);
52
51
std::copy (s, s + n, b + pos_);
You can’t perform that action at this time.
0 commit comments