From afb06fd95cd225fc2aae06b710e3968a89d64353 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Sat, 5 Jan 2019 13:31:25 -0600 Subject: drop mimetypes bugfix for 2.6.x that is no longer needed --- src/pyramid/response.py | 14 -------------- tests/test_response.py | 25 ------------------------- 2 files changed, 39 deletions(-) diff --git a/src/pyramid/response.py b/src/pyramid/response.py index ea4677226..1ccf4fbdc 100644 --- a/src/pyramid/response.py +++ b/src/pyramid/response.py @@ -7,20 +7,6 @@ from webob import Response as _Response from zope.interface import implementer from pyramid.interfaces import IResponse, IResponseFactory - -def init_mimetypes(mimetypes): - # this is a function so it can be unittested - if hasattr(mimetypes, 'init'): - mimetypes.init() - return True - return False - - -# See http://bugs.python.org/issue5853 which is a recursion bug -# that seems to effect Python 2.6, Python 2.6.1, and 2.6.2 (a fix -# has been applied on the Python 2 trunk). -init_mimetypes(mimetypes) - _BLOCK_SIZE = 4096 * 64 # 256K diff --git a/tests/test_response.py b/tests/test_response.py index 18d4335ad..b63ccc6b1 100644 --- a/tests/test_response.py +++ b/tests/test_response.py @@ -120,31 +120,6 @@ class TestFileIter(unittest.TestCase): self.assertTrue(f.closed) -class Test_patch_mimetypes(unittest.TestCase): - def _callFUT(self, module): - from pyramid.response import init_mimetypes - - return init_mimetypes(module) - - def test_has_init(self): - class DummyMimetypes(object): - def init(self): - self.initted = True - - module = DummyMimetypes() - result = self._callFUT(module) - self.assertEqual(result, True) - self.assertEqual(module.initted, True) - - def test_missing_init(self): - class DummyMimetypes(object): - pass - - module = DummyMimetypes() - result = self._callFUT(module) - self.assertEqual(result, False) - - class TestResponseAdapter(unittest.TestCase): def setUp(self): registry = Dummy() -- cgit v1.2.3