summaryrefslogtreecommitdiff
path: root/cherrypy/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'cherrypy/__init__.py')
-rw-r--r--cherrypy/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cherrypy/__init__.py b/cherrypy/__init__.py
index 613a5a18..274f0069 100644
--- a/cherrypy/__init__.py
+++ b/cherrypy/__init__.py
@@ -337,6 +337,10 @@ class _ThreadLocalProxy(object):
def __len__(self):
child = getattr(serving, self.__attrname__)
return len(child)
+
+ def __nonzero__(self):
+ child = getattr(serving, self.__attrname__)
+ return bool(child)
# Create request and response object (the same objects will be used