Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preparser does not respect leading space in front of "load foo.sage" #5052

Closed
dandrake opened this issue Jan 22, 2009 · 4 comments
Closed

preparser does not respect leading space in front of "load foo.sage" #5052

dandrake opened this issue Jan 22, 2009 · 4 comments
Assignees
Milestone

Comments

@dandrake
Copy link
Contributor

If you have something like the following in a file:

try:
    load foo.sage
except:
    print 'uh oh'

it gets preparsed to this, and blows up because of the bad indentation:

try:
execfile("foo.py")
except:
    print 'uh oh'

The preparser is not honoring the leading space before the load statement.

Component: misc

Issue created by migration from https://trac.sagemath.org/ticket/5052

@dandrake
Copy link
Contributor Author

comment:1

Attachment: trac_5052.patch.gz

@dandrake
Copy link
Contributor Author

comment:2

The problem was in sage-preparse; it ran a lstrip() on the line and never took into consideration the indentation.

I wanted to add some doctests, since as we see here, anything not tested is broken -- do the files in $SAGE_ROOT/local/bin get doctested?

@boothby
Copy link

boothby commented Jan 24, 2009

comment:3

works for me

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Jan 28, 2009

comment:4

Merged in Sage 3.3.alpha3

@sagetrac-mabshoff sagetrac-mabshoff mannequin closed this as completed Jan 28, 2009
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants