1

Closed

remove imports from current scope on def f(): line removes imports from parent and function scope

description

print('Hello World')

import os, sys, abc

os.abort


def f():
    import os, sys, abc
    os.abort
    pass
Do remove imports in current scope on def f(): line, imports are removed from both the function scope and the global scope, we should only remove them from one (probably the function scope).
Closed Jun 24 at 6:19 PM by Zooba
This is as intended. The 'def' line is in the outer scope, and "current scope" includes all child scopes.

comments