Skip to content
Snippets Groups Projects
Commit de232952 authored by Vermaat's avatar Vermaat
Browse files

Remove Spyne monkey patch, implemented upstream

parent 590fc39e
No related branches found
No related tags found
No related merge requests found
......@@ -3,8 +3,6 @@ Mutalyzer web service HTTP/RPC with JSON response payloads.
"""
from mutalyzer.util import monkey_patch_spyne; monkey_patch_spyne()
from spyne.application import Application
from spyne.protocol.http import HttpRpc
from spyne.protocol.json import JsonObject
......
......@@ -879,29 +879,3 @@ def monkey_patch_suds():
Import.open = _import_open_patched
Import.MUTALYZER_MONKEY_PATCHED = True
#monkey_patch_suds
def monkey_patch_spyne():
"""
Apply our monkey-patch for the spyne package.
Fault objects cannot be serialized by the JsonObject output protocol,
this fixes it.
Call this function before importing anything from the spyne package. For
example, start your file with the following:
from mutalyzer.util import monkey_patch_spyne; monkey_patch_spyne()
from spyne.protocol.json import JsonObject
"""
from spyne.model.fault import Fault
if hasattr(Fault, '_to_dict'):
return
def _to_dict(self, *args, **kwargs):
return dict(Fault=dict(faultcode=self.faultcode,
faultstring=self.faultstring))
Fault._to_dict = _to_dict
#monkey_patch_spyne
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment