-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue with return in async generators
- Loading branch information
Showing
4 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from dynapyt.analyses.BaseAnalysis import BaseAnalysis | ||
|
||
|
||
class TestAnalysis(BaseAnalysis): | ||
def begin_execution(self): | ||
print("begin execution") | ||
|
||
def function_exit(self, dyn_ast, iid, name, result): | ||
print(f"function {name} exited with result {result}") | ||
|
||
def end_execution(self): | ||
print("end execution") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
begin execution | ||
function foo exited with result 0 | ||
0 | ||
function foo exited with result 1 | ||
1 | ||
function foo exited with result 2 | ||
2 | ||
function main exited with result None | ||
end execution |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
async def foo(): | ||
for i in range(3): | ||
yield i | ||
return | ||
|
||
|
||
async def main(): | ||
async for i in foo(): | ||
print(i) | ||
|
||
|
||
import asyncio | ||
|
||
asyncio.run(main()) |