Skip to content

#4751 reimport same lib with different arguments #4804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

otemek
Copy link
Contributor

@otemek otemek commented Jun 22, 2023

If that's still the case or reasonable to reimport the same library with different arguments then I've made a small change that does that (too simple to believe that it's enough - maybe I'm missing something/some bigger picture of it). IMHO it should allow me to use the "latest" version of an imported library. Anyway - it turns out that the Importer object robotframework/src/robot/running/importer.py:49 returns a new instance of the same library with different arguments, but later the Namespace object checks if that library is imported (only via name attribute) robotframework/src/robot/running/namespace.py:130 and if the names are the same - it does nothing.

If this case sounds like a bug/feature then I'd be glad if maintainers could verify this.
Thanks in advance

@otemek
Copy link
Contributor Author

otemek commented Jul 5, 2023

Closing cause I might have oversimplified this and not considered other scenarios where it's intentional to use the same instance...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant