if macro:
                # Python mistakenly interprets macro names starting and ending with '{' and '}' as a dict
                if isinstance(macro, dict):
                    macro = "{" + six.text_type(macro.keys()[0]) +"}"
                if not macro.startswith('{') and not macro.endswith('}'):