-
-
Save notmyname/8a7d5fd44aea0ce8bbdf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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