dabo Commit
Revision 4565
Date: 2008-10-13 05:30:01 -0700 (Mon, 13 Oct 2008)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/4565
Changed:
U trunk/ide/ClassDesignerEditor.py
Log:
Added work-around for the bug in which a final line that is a comment without a
trailing newline will throw an error in compile().
Diff:
Modified: trunk/ide/ClassDesignerEditor.py
===================================================================
--- trunk/ide/ClassDesignerEditor.py 2008-10-13 12:29:40 UTC (rev 4564)
+++ trunk/ide/ClassDesignerEditor.py 2008-10-13 12:30:01 UTC (rev 4565)
@@ -357,8 +357,12 @@
def onCheckSyntax(self, evt):
ed = self.editor
txt = ed.Value
+ lns = txt.strip().splitlines()
+ # Add an extra blank line to get around the trailing comment bug
+ lns.append("")
+ compText = "\n".join(lns)
try:
- compile(txt.strip(), "", "exec")
+ compile(compText, "", "exec")
dabo.ui.exclaim(_("No syntax errors found!"),
_("Compilation Succeeded"))
except SyntaxError, e:
errMsg = "%s" % e
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]