Improve support for 'with' statements.

Authored by flherne on Oct 9 2018, 5:25 PM.

Description

Improve support for 'with' statements.

The previous code didn't look at __enter__(), and assumed that
all context-managers returned their own type.

We also didn't account for targets other than simple names,
e.g. with Mgr() as (foo, bar):

Thanks to Nicolás Alvarez.

BUG: 399533
BUG: 399534

Differential Revision: https://phabricator.kde.org/D16085

Details

Committed
flherneOct 10 2018, 12:01 AM
Differential Revision
D16085: Improve support for 'with' statements.
Parents
R53:d169b27eda6a: Bump supported Python version to 3.8
Branches
Unknown
Tags
Unknown