Issue #11796 marked as duplicate of this one.
However the issue described in #11796 does not involve exec/execfile.
It is about scopes for list comprehension like this one.
Another doc patch should probably be written to cover the case described in #11796 too.