From cc28226b4afcd1803c9790e8ba238e2125ce0129 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sun, 24 Jul 2011 22:43:26 +0200 Subject: add more assertions for types of passed parameters --- wsgitools/filters.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'wsgitools/filters.py') diff --git a/wsgitools/filters.py b/wsgitools/filters.py index 1c3fadc..e455cbe 100644 --- a/wsgitools/filters.py +++ b/wsgitools/filters.py @@ -238,6 +238,7 @@ class RequestLogWSGIFilter(BaseWSGIFilter): """ BaseWSGIFilter.__init__(self) assert hasattr(log, "write") + assert hasattr(log, "flush") or not flush self.log = log self.flush = flush self.remote = "?" @@ -279,6 +280,7 @@ class RequestLogWSGIFilter(BaseWSGIFilter): @type data: str @rtype: str """ + assert isinstance(data, str) self.length += len(data) return data def handle_close(self): -- cgit v1.2.3