classification
Title: Replace exec() in test.regrtest with __import__
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Ramchandra Apte, eric.snow, python-dev, r.david.murray
Priority: normal Keywords:

Created on 2012-10-17 03:26 by Ramchandra Apte, last changed 2013-01-12 16:35 by r.david.murray. This issue is now closed.

Messages (6)
msg173126 - (view) Author: Ramchandra Apte (Ramchandra Apte) * Date: 2012-10-17 03:26
In Lib/test/regrtest.py:1336 , exec is used to import an module. I think it could be replaced with an __import__ call.
msg173128 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2012-10-17 03:55
Rather, importlib.import_module().  :)
msg173162 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-10-17 12:16
That's a safe use of exec, since the name is coming from a loaded module and not from user input.  Still, load_module would be cleaner.

However, the real fix is to just delete that code.  It is dead code...we always pass the indirect_test argument to dash_R.
msg174306 - (view) Author: Ramchandra Apte (Ramchandra Apte) * Date: 2012-10-31 16:03
Bump.
msg179808 - (view) Author: Ramchandra Apte (Ramchandra Apte) * Date: 2013-01-12 15:13
Boiiummp.
msg179822 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-01-12 16:34
New changeset e22c09f636d4 by R David Murray in branch 'default':
#16259: delete some no-longer-used code from regrtest.
http://hg.python.org/cpython/rev/e22c09f636d4
History
Date User Action Args
2013-01-12 16:35:28r.david.murraysetstatus: open -> closed
resolution: fixed
stage: resolved
2013-01-12 16:34:55python-devsetnosy: + python-dev
messages: + msg179822
2013-01-12 15:13:12Ramchandra Aptesetmessages: + msg179808
2012-10-31 16:03:52Ramchandra Aptesettype: behavior
messages: + msg174306
versions: + Python 3.4
2012-10-17 12:16:55r.david.murraysetnosy: + r.david.murray
messages: + msg173162
2012-10-17 03:55:11eric.snowsetnosy: + eric.snow
messages: + msg173128
2012-10-17 03:26:34Ramchandra Aptecreate