Fix #607, remove return from try when there is a generator inside
Added the contains_yield attr to 'try' when the body it is wrapping contains 'yeild'. Should also address #600 and #563
This commit is contained in:
parent
f8e48628ea
commit
fb7c7e5794
@ -1,10 +1,10 @@
|
|||||||
# -*- encoding: utf-8 -*-
|
# -*- encoding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013 Paul Tagliamonte <paultag@debian.org>
|
# Copyright (c) 2013, 2014 Paul Tagliamonte <paultag@debian.org>
|
||||||
# Copyright (c) 2013 Julien Danjou <julien@danjou.info>
|
# Copyright (c) 2013 Julien Danjou <julien@danjou.info>
|
||||||
# Copyright (c) 2013 Nicolas Dandrimont <nicolas.dandrimont@crans.org>
|
# Copyright (c) 2013 Nicolas Dandrimont <nicolas.dandrimont@crans.org>
|
||||||
# Copyright (c) 2013 James King <james@agentultra.com>
|
# Copyright (c) 2013 James King <james@agentultra.com>
|
||||||
# Copyright (c) 2013 Bob Tolbert <bob@tolbert.org>
|
# Copyright (c) 2013, 2014 Bob Tolbert <bob@tolbert.org>
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
# copy of this software and associated documentation files (the "Software"),
|
# copy of this software and associated documentation files (the "Software"),
|
||||||
@ -704,7 +704,8 @@ class HyASTCompiler(object):
|
|||||||
lineno=expr.start_line,
|
lineno=expr.start_line,
|
||||||
col_offset=expr.start_column)
|
col_offset=expr.start_column)
|
||||||
|
|
||||||
returnable = Result(expr=expr_name, temp_variables=[expr_name, name])
|
returnable = Result(expr=expr_name, temp_variables=[expr_name, name],
|
||||||
|
contains_yield=body.contains_yield)
|
||||||
|
|
||||||
body += ast.Assign(targets=[name],
|
body += ast.Assign(targets=[name],
|
||||||
value=body.force_expr,
|
value=body.force_expr,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user