On Wed, Aug 11, 2010 at 12:44 AM, taa, Leo Newbie <[email protected]> wrote:
> def importFlattenedOutline (self,files): # Not a command, so no
> event arg.
> (snip)
> [line 1114]
> s,e = g.readFileIntoString(fileName)
> if s is None: return
> array = s.split("\n")
>
> Question: Is this line:
>
> s = s.replace("\r","")
>
> missing above the 'If s is None..."?
>
> s,e = g.readFileIntoString(fileName)
> s = s.replace("\r","") <---missing?
> if s is None: return
> array = s.split("\n")
s.replace will crash if s is None. Do this instead:
s,e = g.readFileIntoString(fileName)
if s is None: return ''
s = s.replace("\r","")
etc.
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.