GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — py: fix RunSrc to allow multiple top-level statements (#257) by ncw · Pull Request #258 · go-python/gpython Conversation
Collaborator
Problem
class A: pass class B: pass The equivalent Reported in #257. Root cause
code, err := Compile(pySrc+"\n", pySrcDesc, SingleMode, 0, true)
This has been present since FixCompile in TestAdds Fixes #257
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsRunSrc compiled source in SingleMode, whose interactive grammar only accepts a single top-level statement. Source with more than one statement (e.g. two class definitions) failed with SyntaxError, while the equivalent RunFile path (which uses ExecMode) worked fine. Compile in ExecMode instead, matching RunFile and the semantics of Python's exec() for a source buffer, and add a regression test. Fixes #257
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Multiple class definitions in the same file raise error "invalid syntax"Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |