diff options
Diffstat (limited to 'cherrypy/__init__.py')
-rw-r--r-- | cherrypy/__init__.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cherrypy/__init__.py b/cherrypy/__init__.py index 2c2443f0..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() |