Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

Get support for new 3.5 Python coroutines #75

Merged
merged 3 commits into from
Oct 20, 2017
Merged

Conversation

pfreixes
Copy link
Contributor

@pfreixes pfreixes commented Oct 7, 2016

This commit implement the proper stuff to decorate
the new coroutine style implemented by Python3.5 and their new
statments, making the canonical profile decorator compatible.

To hide incompatible 3.5 statements between versions. The idea is be able
to run all Python versions, since 2.X to 3.5 without break the current behaviour.
The Python 3.5 specific code is hidden into private files that will be imported only in
3.5 environments.

This commit implement the proper stuff to decorate
the new coroutine style implemented by Python3.5 and their new
statments, making the canonical `profile` decorator compatible.

To hide incompatible 3.5 statements between versions. The idea is be able
to run all Python versions, since 2.X to 3.5 without break the current behaviour.
The Python 3.5 specific code is hidden into private files that will be imported only in
3.5 environments.
"""
Wrap a Python 3.5 coroutine to profile it.
"""
@functools.wraps(func)

Choose a reason for hiding this comment

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

this file is missing import functools

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, fixed.

@jhrmnn
Copy link

jhrmnn commented Jun 9, 2017

Btw, this can be simply rebased on top of the current master and seems to work in Python 3.6.1.

@pfreixes
Copy link
Contributor Author

pfreixes commented Jun 9, 2017

@rkern ping ....

@jhrmnn
Copy link

jhrmnn commented Jun 9, 2017

Hm, ok, in Python 3.6, it works when pip-installed in devel mode, but otherwise it crashes with

ModuleNotFoundError: No module named 'line_profiler_py35'

@pfreixes
Copy link
Contributor Author

pfreixes commented Jun 9, 2017

@Azag0 should be fixed with the last commit

@jhrmnn
Copy link

jhrmnn commented Jun 10, 2017

Yep, works now.

@pfreixes
Copy link
Contributor Author

@caethan @Nodd @kmike ... this MR was here for more than half year, looks like people might be interested. any thoughts/comments?

@caethan
Copy link
Collaborator

caethan commented Oct 9, 2017

Will try to take a look at it this week.

@pfreixes
Copy link
Contributor Author

@caethan any news about that?

@caethan
Copy link
Collaborator

caethan commented Oct 20, 2017

Looks good! Thanks for the patience and sorry for the delay in reviewing it. I'll merge it and see about going through other pull requests to see if anything else should get pulled in for a 2.1 release.

@caethan caethan merged commit e20658e into rkern:master Oct 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants