handle Py2 compatibility case bytearray.append(pychar)

--HG--
extra : amend_source : f3b7f004f905c791e6ced2a5b27fffa21f9ceb08
merge