summaryrefslogtreecommitdiff
path: root/cherrypy/wsgiserver/wsgiserver2.py
diff options
context:
space:
mode:
Diffstat (limited to 'cherrypy/wsgiserver/wsgiserver2.py')
-rw-r--r--cherrypy/wsgiserver/wsgiserver2.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/cherrypy/wsgiserver/wsgiserver2.py b/cherrypy/wsgiserver/wsgiserver2.py
index 175affc1..f3ae1f9d 100644
--- a/cherrypy/wsgiserver/wsgiserver2.py
+++ b/cherrypy/wsgiserver/wsgiserver2.py
@@ -102,6 +102,10 @@ except ImportError:
# Python 2.6
import io
+try:
+ import pkg_resources
+except ImportError:
+ pass
if 'win' in sys.platform and hasattr(socket, "AF_INET6"):
if not hasattr(socket, 'IPPROTO_IPV6'):
@@ -113,6 +117,12 @@ if 'win' in sys.platform and hasattr(socket, "AF_INET6"):
DEFAULT_BUFFER_SIZE = io.DEFAULT_BUFFER_SIZE
+try:
+ cp_version = pkg_resources.require('cherrypy')[0].version
+except Exception:
+ cp_version = 'unknown'
+
+
class FauxSocket(object):
"""Faux socket with the minimal interface required by pypy"""
@@ -1756,7 +1766,7 @@ class HTTPServer(object):
timeout = 10
"""The timeout in seconds for accepted connections (default 10)."""
- version = "CherryPy/5.1.0"
+ version = "CherryPy/" + cp_version
"""A version string for the HTTPServer."""
software = None