X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/36a1dad6e8487ed9c723422b7b010f9edd8bf1e8..3d2d9036037d9ee51f47d878c3dcef4af4a6ef41:/wxPython/wx/lib/wxpTag.py diff --git a/wxPython/wx/lib/wxpTag.py b/wxPython/wx/lib/wxpTag.py index d93a9fa9b1..5de374e990 100644 --- a/wxPython/wx/lib/wxpTag.py +++ b/wxPython/wx/lib/wxpTag.py @@ -169,7 +169,8 @@ class wxpTagHandler(wx.html.HtmlWinTagHandler): obj.Show(True) # add it to the HtmlWindow - self.GetParser().GetContainer().InsertCell(wx.html.HtmlWidgetCell(obj, self.ctx.floatWidth)) + self.GetParser().GetContainer().InsertCell( + wx.html.HtmlWidgetCell(obj, self.ctx.floatWidth)) self.ctx = None return True @@ -195,7 +196,7 @@ class wxpTagHandler(wx.html.HtmlWinTagHandler): # check for something that should be evaluated - elif value[0] in '[{(' or value[:2] == 'wx': + elif value and value[0] in '[{(' or value[:2] == 'wx': saveVal = value try: value = eval(value, self.ctx.classMod.__dict__) @@ -203,7 +204,7 @@ class wxpTagHandler(wx.html.HtmlWinTagHandler): value = saveVal # convert to wx.Colour - elif value[0] == '#': + elif value and value[0] == '#': try: red = int('0x'+value[1:3], 16) green = int('0x'+value[3:5], 16) @@ -212,7 +213,8 @@ class wxpTagHandler(wx.html.HtmlWinTagHandler): except: pass - self.ctx.kwargs[str(name)] = value + if self.ctx: + self.ctx.kwargs[str(name)] = value return False