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

Fix KeyError Exception if ENV isn't defined. #7

Merged
merged 1 commit into from
Aug 7, 2018

Conversation

nuno-andre
Copy link
Contributor

Also, the ternary conditional isn't needed. The comparison already returns a bool.

Also, the ternary conditional isn't needed. The comparison already returns a bool.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 18

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 88.679%

Totals Coverage Status
Change from base Build 17: 0.0%
Covered Lines: 47
Relevant Lines: 53

💛 - Coveralls

1 similar comment
@coveralls
Copy link

Pull Request Test Coverage Report for Build 18

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 88.679%

Totals Coverage Status
Change from base Build 17: 0.0%
Covered Lines: 47
Relevant Lines: 53

💛 - Coveralls

@greyli greyli merged commit 34de621 into helloflask:master Aug 7, 2018
@greyli
Copy link
Member

greyli commented Aug 7, 2018

Thanks!

@greyli
Copy link
Member

greyli commented Aug 7, 2018

Do you actually get the KeyError? It seems that the ENV configuration variable was defined by Flask when the app instance was created.

@nuno-andre nuno-andre deleted the patch-1 branch August 7, 2018 08:26
@nuno-andre
Copy link
Contributor Author

Thanks to you! Yes. I got it the exception with Flask 0.12.4, the last pre-1.0 (April 2018).

FLASK_DEV was introduced as of version 1.0. From 0.11 to 0.12 the recommended method of enabling the development server was through FLASK DEBUG. So before 1.0 development server and debug mode meant the same to Flask.

I made a PR to honor this equivalence that sets dev = FLASK_DEBUG only if there is not a FLASK_DEV.

@greyli
Copy link
Member

greyli commented Aug 10, 2018

Oh, you are right. I forgot the old version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants