On 6/23/10 6:05 AM, David Poetzsch-Heffter wrote:
Hi!
I found (and fixed) a few Bugs in the file local/bin/sage-preparse.
These are the things I fixed:
* The module docstrings disappeared when preparsing because the
preparse_file function inserted those numeric_literals definitions before
the docstrings.
This sounds like it may cause another problem I noticed the other day.
When doing:
from __future__ import division
3.5/2.0
in a Sage notebook cell, we get the error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_6.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8
-*-\\n" +
_support_.preparse_worksheet_cell(base64.b64decode("ZnJvbSBfX2Z1dHVyZV9fIGltcG9ydCBkaXZpc2lvbgoKMy41LzIuMA=="),globals())+"\\n");
execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/tmp/tmp89rHOA/___code___.py", line 3
from __future__ import division
SyntaxError: from __future__ imports must occur at the beginning of the
file
Do you know if your patch fixes this issue?
Thanks,
Jason
--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org