diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2017-12-17 11:21:42 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2017-12-17 11:21:42 -0500 |
commit | 4724fb3c4e51898c06259fb3807766329d767774 (patch) | |
tree | 3256ba9a412f2505a77afba594bc84e0c5ba8410 | |
parent | 951489bcf1d0db047d53b303b6b077272a8245d2 (diff) | |
download | cherrypy-git-call-aside.tar.gz |
Use call_aside to call a function as it's defined.call-aside
-rw-r--r-- | cherrypy/lib/static.py | 7 | ||||
-rwxr-xr-x | setup.py | 1 |
2 files changed, 4 insertions, 4 deletions
diff --git a/cherrypy/lib/static.py b/cherrypy/lib/static.py index ed6467a0..ffedb611 100644 --- a/cherrypy/lib/static.py +++ b/cherrypy/lib/static.py @@ -5,17 +5,19 @@ import platform import re import stat import mimetypes - from email.generator import _make_boundary as make_boundary from io import UnsupportedOperation from six.moves import urllib +from jaraco.functools import call_aside + import cherrypy from cherrypy._cpcompat import ntob from cherrypy.lib import cptools, httputil, file_generator_limited +@call_aside def _setup_mimetypes(): """Pre-initialize global mimetype map.""" if not mimetypes.inited: @@ -26,9 +28,6 @@ def _setup_mimetypes(): mimetypes.types_map['.gz'] = 'application/x-gzip' -_setup_mimetypes() - - def serve_file(path, content_type=None, disposition=None, name=None, debug=False): """Set status, headers, and body in order to serve the given path. @@ -59,6 +59,7 @@ install_requires = [ 'six>=1.11.0', 'cheroot>=5.9.1', 'portend>=2.1.1', + 'jaraco.functools', ] extras_require = { |