# HG changeset patch # User Mads Kiilerich # Date 2019-11-24 21:40:05 # Node ID b075693b32145777843b037141f7f881f6412cc3 # Parent 4b7909501c5ce231fd6665d71dbaf9b00e454bc9 pygrack: address webob AcceptValidHeader DeprecationWarning Got warnings like: kallithea/tests/other/test_vcs_operations.py::TestVCSOperations::test_yada_yada .../site-packages/webob/acceptparse.py:649: DeprecationWarning: The behavior of AcceptValidHeader.__contains__ is currently being maintained for backward compatibility, but it will change in the future to better conform to the RFC. DeprecationWarning, There *must* be a better alternative to pygrack ... for now, let's keep it alive. diff --git a/kallithea/lib/middleware/pygrack.py b/kallithea/lib/middleware/pygrack.py --- a/kallithea/lib/middleware/pygrack.py +++ b/kallithea/lib/middleware/pygrack.py @@ -186,7 +186,7 @@ class GitRepository(object): _path = self._get_fixedpath(req.path_info) if _path.startswith('info/refs'): app = self.inforefs - elif [a for a in self.valid_accepts if a in req.accept]: + elif req.accept.acceptable_offers(self.valid_accepts): app = self.backend try: resp = app(req, environ)