summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/asynchat.py')
-rw-r--r--Lib/asynchat.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/asynchat.py b/Lib/asynchat.py
index ac83eeae72b..e5337f7e7c8 100644
--- a/Lib/asynchat.py
+++ b/Lib/asynchat.py
@@ -181,6 +181,9 @@ class async_chat (asyncore.dispatcher):
self.close()
def push (self, data):
+ if not isinstance(data, (bytes, bytearray, memoryview)):
+ raise TypeError('data argument must be byte-ish (%r)',
+ type(data))
sabs = self.ac_out_buffer_size
if len(data) > sabs:
for i in range(0, len(data), sabs):