Skip to content

Instantly share code, notes, and snippets.

@notmyname
Created March 26, 2014 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save notmyname/8a7d5fd44aea0ce8bbdf to your computer and use it in GitHub Desktop.
Save notmyname/8a7d5fd44aea0ce8bbdf to your computer and use it in GitHub Desktop.
diff --git a/swift/common/wsgi.py b/swift/common/wsgi.py
index 417b161..5b05811 100644
--- a/swift/common/wsgi.py
+++ b/swift/common/wsgi.py
@@ -131,8 +131,10 @@ def monkey_patch_mimetools():
self.plisttext = ''
else:
orig_parsetype(self)
+ parsetype.patched = True
- mimetools.Message.parsetype = parsetype
+ if getattr(mimetools.Message.parsetype, 'patched', None):
+ mimetools.Message.parsetype = parsetype
def get_socket(conf, default_port=8080):
diff --git a/test/unit/proxy/test_server.py b/test/unit/proxy/test_server.py
index ed037b8..43ab3dc 100644
--- a/test/unit/proxy/test_server.py
+++ b/test/unit/proxy/test_server.py
@@ -679,7 +679,6 @@ class TestObjectController(unittest.TestCase):
account_ring=FakeRing(),
container_ring=FakeRing(),
object_ring=FakeRing())
- monkey_patch_mimetools()
def tearDown(self):
self.app.account_ring.set_replicas(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment