You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// DeleteNamedImport deletes the import with the given name and path from the file f, if present.
And it works as expected. It's a low-level AST manipulation primitive that allows one to delete the exact import statement with the provided name and import path.
astutil.AddNamedImport has a symmetrical signature, and its documentation suggests it would do the symmetrical operation of adding an optionally renamed import.
However, it has a bug where once the AST has an import with the specified import path, it's not possible to add other imports with the same import path but different names.
I have a fix with test cases, will send a CL soon. /cc @heschik @alandonovan
astutil.DeleteNamedImport
is documented as:And it works as expected. It's a low-level AST manipulation primitive that allows one to delete the exact import statement with the provided name and import path.
astutil.AddNamedImport
has a symmetrical signature, and its documentation suggests it would do the symmetrical operation of adding an optionally renamed import.However, it has a bug where once the AST has an import with the specified import path, it's not possible to add other imports with the same import path but different names.
I have a fix with test cases, will send a CL soon. /cc @heschik @alandonovan
This bug is causing #16411.
The text was updated successfully, but these errors were encountered: