Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def dump(self, obj):
try:
CloudPickler.dump(self,obj)
except PicklingError, p:
cloudLog.exception("pickling failed on %s of type %s."
% (self.lastobj, type(self.lastobj)))
strio = StringIO()
xmlf = xmlhandlers.XmlWriter(strio,header=False)
xmlmid = xmlhandlers.XmlStackWriter(xmlf)
#xmlmid = xmlf
self.aborting = True
try: #intentionally crash at partial xml
self.dump_obj(xmlmid, obj, self.print_top_level, None, {}, abortObject = self.lastobj)
except DebugPicklingError, e:
if e.args[0] != 'fake exit':
raise
except RuntimeError, e: # dump_obj will crash w/ infinite recursion if regular dump did