summaryrefslogtreecommitdiff
path: root/cherrypy/__init__.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-04-30 11:45:18 -0400
committerJason R. Coombs <jaraco@jaraco.com>2016-04-30 11:45:18 -0400
commitbaf1cfad6a76e98adc078f36a70a5ceecd6138fb (patch)
tree61ccef2f4f66a3fb56863db1d03098deb24c4439 /cherrypy/__init__.py
parent32a163ca17e1c3d78945ad2214e6c1fb5a8e0bf1 (diff)
parent7f77d77d18234382582c8a3a3e2a526841e900ba (diff)
downloadcherrypy-baf1cfad6a76e98adc078f36a70a5ceecd6138fb.tar.gz
Merge https://bitbucket.org/cherrypy/cherrypy/pull-requests/125/
Diffstat (limited to 'cherrypy/__init__.py')
-rw-r--r--cherrypy/__init__.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/cherrypy/__init__.py b/cherrypy/__init__.py
index 6e2f9bdb..30a8cadf 100644
--- a/cherrypy/__init__.py
+++ b/cherrypy/__init__.py
@@ -56,7 +56,10 @@ with customized or extended components. The core API's are:
These API's are described in the `CherryPy specification <https://bitbucket.org/cherrypy/cherrypy/wiki/CherryPySpec>`_.
"""
-__version__ = "5.1.0"
+try:
+ import pkg_resources
+except ImportError:
+ pass
from cherrypy._cpcompat import urljoin as _urljoin, urlencode as _urlencode
from cherrypy._cpcompat import basestring, unicodestr
@@ -88,6 +91,12 @@ except ImportError:
engine = process.bus
+try:
+ __version__ = pkg_resources.require('cherrypy')[0].version
+except Exception:
+ __version__ = 'unknown'
+
+
# Timeout monitor. We add two channels to the engine
# to which cherrypy.Application will publish.
engine.listeners['before_request'] = set()
@@ -318,7 +327,7 @@ class _GlobalLogManager(_cplogging.LogManager):
"""Log the given message to the app.log or global log as appropriate.
"""
# Do NOT use try/except here. See
- # https://bitbucket.org/cherrypy/cherrypy/issue/945
+ # https://github.com/cherrypy/cherrypy/issues/945
if hasattr(request, 'app') and hasattr(request.app, 'log'):
log = request.app.log
else: