Skip to content

bpo-34084: Fix setting an error message for the "Barry as BDFL" easter egg. #8262

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

Merged
merged 1 commit into from
Jul 23, 2018

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Jul 12, 2018

@@ -4,18 +4,29 @@
class FLUFLTests(unittest.TestCase):

def test_barry_as_bdfl(self):
code = "from __future__ import barry_as_FLUFL; 2 {0} 3"
code = "from __future__ import barry_as_FLUFL\n2 {0} 3"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not familiar with compile. My question is when flags is passed, what's the meaning of the import here? Is it a must?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is redundant if flags is passed.

The bug is that this tests is failed if not pass flags.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know flags have to be passed. I just don't understand why not simply '2 {0} 3'?.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intention of the test is that from __future__ import barry_as_FLUFL should change grammar. But this doesn't work, and we need to pass flags as a temporary workaround. After fixing this bug we could remove flags.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotcha. I wrongly thought the from __future__ import ... doesn't work in compile and flags must be passed.

@miss-islington
Copy link
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7.
🐍🍒⛏🤖

@serhiy-storchaka serhiy-storchaka deleted the flufl branch July 23, 2018 20:41
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 23, 2018
…r egg. (pythonGH-8262)

(cherry picked from commit aba24ff)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-bot
Copy link

GH-8423 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 23, 2018
…r egg. (pythonGH-8262)

(cherry picked from commit aba24ff)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-bot
Copy link

GH-8424 is a backport of this pull request to the 3.6 branch.

serhiy-storchaka added a commit that referenced this pull request Jul 23, 2018
…r egg. (GH-8262) (GH-8423)

(cherry picked from commit aba24ff)

Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka added a commit that referenced this pull request Jul 23, 2018
…r egg. (GH-8262) (GH-8424)

(cherry picked from commit aba24ff)

Co-authored-by: Serhiy Storchaka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants