summaryrefslogtreecommitdiff
path: root/indra/lib
diff options
context:
space:
mode:
Diffstat (limited to 'indra/lib')
-rw-r--r--indra/lib/python/indra/base/llsd.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/indra/lib/python/indra/base/llsd.py b/indra/lib/python/indra/base/llsd.py
index 9e636ea423..76855deb7f 100644
--- a/indra/lib/python/indra/base/llsd.py
+++ b/indra/lib/python/indra/base/llsd.py
@@ -215,8 +215,12 @@ class LLSDXMLFormatter(object):
def format(self, something):
return '<?xml version="1.0" ?>' + self.elt("llsd", self.generate(something))
+_g_xml_formatter = None
def format_xml(something):
- return LLSDXMLFormatter().format(something)
+ global _g_xml_formatter
+ if _g_xml_formatter is None:
+ _g_xml_formatter = LLSDXMLFormatter()
+ return _g_xml_formatter.format(something)
class LLSDNotationFormatter(object):
def __init__(self):