Avoid accessing the configuration on import in the arcwrapper code.#350
Avoid accessing the configuration on import in the arcwrapper code.#350
Conversation
|
Thanks for trying, but I think it's time to simply retire the |
Ok. To be honest I just needed to move this out of the way, so removal is also good. If you can confirm you'd be cool seeing a PR that removed al of this I will go ahead - if you let me know what needs to be done with the following callers I can proceed with that:
|
A PR would be great, thanks.
I think a |
|
This PR is replaced by a wholesale removal here: #359 |
This code is written to load a configuration object at its outer most level, meaning that any import causes trying to load a configuration which could well not exist. Worse, there are some places that unconditionally import this. As things stand there would be no way to test this and no way to pass a particular configuration to it.
Looking into this, all the uses of this code start by attempting to instantiate a class exposed by this code. This lead to the following idea: allow import to succeed but unilaterally error when trying to instantiate the object this relies on. All paths doing so already have error handling. This commit does that, leading to a rather minimal change which makes the configuration an argument to the constructor.