From 4fdc2179e25926d531ea8c4a5d6fc78ce75cd6ff Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Tue, 10 Jul 2012 16:34:39 +1200 Subject: [PATCH] Don't write empty values. --- netlib/tcp.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/netlib/tcp.py b/netlib/tcp.py index 53ad8a05d..6ba58d868 100644 --- a/netlib/tcp.py +++ b/netlib/tcp.py @@ -63,10 +63,11 @@ class FileLike: return result def write(self, v): - try: - return self.o.sendall(v) - except SSL.SysCallError: - raise NetLibDisconnect() + if v: + try: + return self.o.sendall(v) + except SSL.SysCallError: + raise NetLibDisconnect() def readline(self, size = None): result = ''