Commit eb8142ae authored by Charles Ferguson's avatar Charles Ferguson
Browse files

Ensure that StyledString can repr when aborting early on.

Move up some member variables so that the repr is valid when needed
early on, if we get a failure early in the run.
parent 6a162ccf
......@@ -318,6 +318,8 @@ class StyledString(object):
def __init__(self, s, style=None):
self.sequence = [] = style
self.simplified = False
if s is not None and s != '':
if isinstance(s, StyledString):
# If it was a StyledString container, we can remove a level of
......@@ -330,8 +332,6 @@ class StyledString(object):
s = unicode(s)
if s is not None:
self.sequence.append(s) = style
self.simplified = False
def __repr__(self):
# We indicate with the first letter of the bracketted content whether the
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment