@@ -2100,8 +2100,9 @@ def test_singletons(self):
21002100 with self .subTest (size = size , ch = ch ):
21012101 ch = chr (ch )
21022102
2103- # If the first write is a Latin1 character, use the
2104- # singleton as the read-only buffer
2103+ # If the first write is a Latin1 character and no buffer
2104+ # was allocated yet, use the singleton as the read-only
2105+ # buffer
21052106 writer = self .create_writer (size )
21062107 writer .write_char (ord (ch ))
21072108 self .assertIs (writer .finish (), ch )
@@ -2165,7 +2166,7 @@ def test_change_kind(self):
21652166
21662167 def test_readonly_optim (self ):
21672168 # Read-only optimization: if the first and only write is a Python str
2168- # object, return the object unchanged
2169+ # object and no buffer was allocated yet , return the object unchanged
21692170 unique_string = 'unique string'
21702171 writer = self .create_writer (0 )
21712172 writer .write_str (unique_string )
@@ -2228,7 +2229,7 @@ def test_recover_error(self):
22282229
22292230 def test_readonly_optim (self ):
22302231 # Read-only optimization: if the first and only write is a Python str
2231- # object, return the object unchanged
2232+ # object and no buffer was allocated yet , return the object unchanged
22322233 from ctypes import py_object
22332234
22342235 unique_string = 'unique string'
0 commit comments