Skip to content

Use functools.wraps when wrapping synchronous handlers#1953

Merged
asvetlov merged 1 commit intoaio-libs:masterfrom
Gallaecio:handler_doc
Jun 5, 2017
Merged

Use functools.wraps when wrapping synchronous handlers#1953
asvetlov merged 1 commit intoaio-libs:masterfrom
Gallaecio:handler_doc

Conversation

@Gallaecio
Copy link

@Gallaecio Gallaecio commented Jun 5, 2017

What do these changes do?

They change the code that wraps synchronous functions, using functools.wraps to ensure that aspects from the synchronous functions such as __doc__ are also available on the wrapper.

This allows to use aiohttp-swagger with synchronous handlers.

Are there changes in behavior for the user?

When accessed from the app, synchronous route handlers will now include additional metadata that before only asynchronous handlers provided.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
    It’s a bug fix which should not affect the documentation.
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new entry to CHANGES.rst
    • Choose any open position to avoid merge conflicts with other PRs.
    • Add a link to the issue you are fixing (if any) using #issue_number format at the end of changelog message. Use Pull Request number if there are no issues for PR or PR covers the issue only partially.

@codecov-io
Copy link

codecov-io commented Jun 5, 2017

Codecov Report

Merging #1953 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1953      +/-   ##
==========================================
+ Coverage   97.05%   97.05%   +<.01%     
==========================================
  Files          37       37              
  Lines        7610     7612       +2     
  Branches     1328     1328              
==========================================
+ Hits         7386     7388       +2     
  Misses        101      101              
  Partials      123      123
Impacted Files Coverage Δ
aiohttp/web_urldispatcher.py 99.41% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1e59d63...617241d. Read the comment docs.

@asvetlov asvetlov merged commit 9904f82 into aio-libs:master Jun 5, 2017
@asvetlov
Copy link
Member

asvetlov commented Jun 5, 2017

Thanks!

@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants