please refactor the code:
```
if modules is None:
    self.log.deprecated("Unloading modules listed in _modules class variable", '2.0') 
     modules=self._modules[:]
``` 
or something like that.
it's easier to remove later