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

False positive with R503 inside with clause #4

Closed
thehesiod opened this issue Aug 17, 2019 · 1 comment
Closed

False positive with R503 inside with clause #4

thehesiod opened this issue Aug 17, 2019 · 1 comment

Comments

@thehesiod
Copy link

  • Date you used flake8-return: 8/16/2019
  • flake8-return version used, if any: 1.1.0
  • Python version, if any: 3.6.6
  • Operating System: OSX

Description

With a function like the following:

async def function():
    async with thing as foo:
        return foo.bar

This is valid because there can be no other return than the one inside the with context. If enter/exit raise then nothing after it will run. The one way this is not true is if you capture the exeption with a try/except around the async with clause.

@afonasev
Copy link
Owner

I'll try to fix it soon, thx

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

No branches or pull requests

2 participants