Message157116
Huh? Demonstration please, as the -m switch absolutely does display tracebacks when the call fails:
$ python -m timeit -s "raise RuntimeError"
Traceback (most recent call last):
File "/usr/lib64/python2.7/timeit.py", line 298, in main
x = t.timeit(number)
File "/usr/lib64/python2.7/timeit.py", line 194, in timeit
timing = self.inner(it, self.timer)
File "<timeit-src>", line 3, in inner
raise RuntimeError
RuntimeError
The only tracebacks it suppresses are those for ImportError during the search process, which is deliberate:
$ python -m missing
/usr/bin/python: No module named missing
It even avoids suppressing the traceback when the module is found and an import error occurs later:
$ python -m timeit -s "import missing"
Traceback (most recent call last):
File "/usr/lib64/python2.7/timeit.py", line 298, in main
x = t.timeit(number)
File "/usr/lib64/python2.7/timeit.py", line 194, in timeit
timing = self.inner(it, self.timer)
File "<timeit-src>", line 3, in inner
import missing
ImportError: No module named missing |
|
Date |
User |
Action |
Args |
2012-03-30 01:23:35 | ncoghlan | set | recipients:
+ ncoghlan, vstinner |
2012-03-30 01:23:35 | ncoghlan | set | messageid: <1333070615.18.0.149806895013.issue14439@psf.upfronthosting.co.za> |
2012-03-30 01:23:34 | ncoghlan | link | issue14439 messages |
2012-03-30 01:23:34 | ncoghlan | create | |
|