Skip to content

Commit

Permalink
drop mimetypes bugfix for 2.6.x that is no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
mmerickel committed Jan 5, 2019
1 parent c02f228 commit afb06fd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
14 changes: 0 additions & 14 deletions src/pyramid/response.py
Expand Up @@ -7,20 +7,6 @@
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


Expand Down
25 changes: 0 additions & 25 deletions tests/test_response.py
Expand Up @@ -120,31 +120,6 @@ def test_close(self):
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()
Expand Down

0 comments on commit afb06fd

Please sign in to comment.