[New-bugs-announce] [issue14715] test.support.DirsOnSysPath should be replaced by importlib.test.util.import_state

Eric V. Smith report at bugs.python.org
Thu May 3 23:04:29 CEST 2012


New submission from Eric V. Smith <eric at trueblade.com>:

DirsOnSysPath doesn't clear sys.path_importer_cache, so it seems you'd always want to use import_state, which does clear it.

We might also want to modify import_state to remember the original objects, not just their values. DirsOnSysPath does do this, for sys.path.

If we do this, we should probably move import_state to test.support.

Also, couldn't import_state do with sys.modules what DirsOnSysPath does with sys.path? It could restore both the object and its contents.

----------
messages: 159873
nosy: barry, brett.cannon, eric.smith, jason.coombs
priority: normal
severity: normal
status: open
title: test.support.DirsOnSysPath should be replaced by importlib.test.util.import_state
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14715>
_______________________________________


More information about the New-bugs-announce mailing list